Hello,
I'm caught in a somewhat difficult question in my C++ course at college. The question pertains to for loops and the calculation of exponents. The question is as follows:
This specific question deals with the for loop. I'm not sure how to go about performing this calculation. First, I could increment the variable product while product is <= to 6 to get all six exponents recognized. But then, where would the answer for each respective operation be stored. I'm not sure how to calculate exponents either without using a massive set of if-else statements, which may or may not be permitted on this question (I don't believe its permitted)Start with integer objects n and product. Initialize product = 1 and use the loops to output the powers (n^1, n^2... n^6) for exponents 1 through 6
Thank you for your help,
Travis