Here's what I thought of so far which works for 2 elements in the array. the elements in the array are the variables to be plugged in to the continued fraction.
double continuedFraction(int a[], int size)
{
double fraction = a[0];
for(int i = 1; i < size; i++)
{
fraction += (double)1/(double)a[i];
}
return fraction;
}
btw I'm not using recursion I need to be able to get the continued fraction result.