#### Lesson topics

#### Demo 9

program addpowers c This program adds powers of integers from 1 to n. c The user inputs the power and the integer n. real sum, power integer i, n print *, "Enter a power : " read *, power print *, "At what integer n do you wish to stop the sum ?" read *, n sum = 0 do i = 1, n sum = sum + i ** power end do print * print *, "Here is the sum of the integers to the power", power print *, "from i = 1 to i = ", n, ":", sum end