It's just an exercise to learn about using loops. I admit given the built-in tools to calculate powers it may look stupid, but nevertheless you have to do it if it is the requirement of your homework. Note that they want you to use for loop, not while loop.
Also, it's not clear how restrictive you should be about exp, e.g. do you accept negative numbers, do you accept 0, do you accept float? Or you accept just positive int as exp?
Also, it's not clear how restrictive you should be about exp, e.g. do you accept negative numbers, do you accept 0, do you accept float? Or you accept just positive int as exp?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs