Heres what the problem says to do:
Write a function PowerOf() that calculates and returns the value of x^n. (Hint: A for loop can be used to calculate the power.) Use the function header:
double PowerOf(double x, int n)
/*Returns x to the ntn power
n assumed >=0 */
My question is what do I put in the for loop it says to use to calculate the power? Im not very good in math questions like this, so any help would be greatly appreciated.
Write a function PowerOf() that calculates and returns the value of x^n. (Hint: A for loop can be used to calculate the power.) Use the function header:
double PowerOf(double x, int n)
/*Returns x to the ntn power
n assumed >=0 */
My question is what do I put in the for loop it says to use to calculate the power? Im not very good in math questions like this, so any help would be greatly appreciated.