To anybody that may know and can help me. I am not looking for an answer to anything I just need to know to write this equation in C++

Attachments
4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by rbduck09

ı will try to do:)

``````int num(int i, int n) {
for (int i=0; i<n;++i)
{
int k=1;
k=k*(1+i);
}

return k;
}``````

result = (p*i*num(i,n))/(num(i,n)-1);

We don't "do" things for people. We help them solve their own problems.

Programming is about decomposing large problems into smaller problems. You need to solve the small problems, then combine the small solutions into a solution to the larger problem.

What do the different variables and portions of the equation represent?

You should be able to create an "compounding" (or similarly named) variable to represent the solution to [tex](1+i)^n[/tex] then use it's value in both places it appears.

Once you have that, you should be able to calculate the "numerator" and "denominator" then go from there.

Edited by Fbody: n/a

``a= (p * i * pow( (i+1) , n) ) / (pow( (i+1) , n ) - 1 );``
``a= (p * i * pow( (i+1) , n) ) / (pow( (i+1) , n ) - 1 );``