Write a program to print the following output by calculating the result.
2^1 , 4^3, 6^5, 8^5, … , n^(n-1)
Where n is an even number.
I can't make this. Just give me hints on making this program. Please do not right down the code.
And I'm a newbie, the only library I know is <iostream>.
I'm also aware of arrays, the 3 types of loops(while, for, do-while), if-else and of-course the arithmetic functions too.
It's quite simple. Create two integer variables. Initialize the first one to 2, and the second one to 1. And then use a loop that run a number of times, while increasing n by 2 each iteration, which is what is happening here - 2^1 , 4^3, 6^5, 8^7.