0

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 Capture.PNG 1.81 KB
4
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by rbduck09
-1
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);

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

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

-1
a= (p * i * pow( (i+1) , n) ) / (pow( (i+1) , n ) - 1 );
Votes + Comments
I thought he said he did not want the answer, just help
0
a= (p * i * pow( (i+1) , n) ) / (pow( (i+1) , n ) - 1 );

Thank You Very Much

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.