CSC 160 - Computer Programming for Non-majors

Dr. R. M. Siegfried

Assignment #9 - Exponentiation

Due Thursday, October 22, 2015

Exponentiation (or raising a number to a certain power) is a matter of repeated multiplication.i.e.,

xn = x * x * ... * x
E. g.,
x4 = 1 * x * x * x * x

Write a program that asks the user for a value and then for the power to which you will raise that value. Then multiply the value by itself n times.

Please remember that you need to initialize the product to 1 and then multiply the product by x n times.

[Back to the Assignments Index]