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++

Recommended Answers

All 5 Replies

ı 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);

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

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.

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

Thank You Very Much

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.