First of ALL my C++ Version: Borland C++ 3.0
So, the question is to make a code for the following:
1 + x/1! + x3/2! + x5/3! ..............
I've made the following code, where b or n is Number of terms, and x or a is the in putted value of x. I am not able to figure out how to make the code for denominator i.e. how do I make 1!, 2!, 3! etc appear under denominator.
So you got the formula, and as far as I can see you also got a loop which calculates 1 + x + x3 + x 5 and so on. What you need is therefore some way to calculate 1!, 2!, 3! and so on. This is exactly what the for loop I posted does.
Then you take your loop and modify it:
1 2 3 4
sum = sum + pow(x,j)/demonimators[i-1];
So you calculate the denominators before you execute the modified version of the loop you already have and store them in denominators. Then you can use the modified loop above.