i'm trying to teach my self C++ and was doing ok until i hit a typo in the book. it's an older deitel book. it asks to write a bunch of statements and then use them in a program. the typo involves this question:
g) test y to see if it is less than or equal to x.
the answer given is:
g) if(i <= y)
i can live with that being wrong. the problem comes with the next question and my lack of ability to remember math most likely.
"write a C++ program that uses the previous statements to calculate x raised to the y power. the program should use a while repetition control structure."
the base and exponent are input by the user, why would it even need to use while in the first place? maybe it's just the typo that's confusing me? or my forgetting simple math? either way, if ya'll could point me in the right direction to figure this out it would be greatly appreciated.