a program that asks for input n and prints a sequence of powers of 5 from 5^0 to 5^

A.Write a program that asks for input n and prints a sequence of powers of 5 from 5^0 to 5^n in separate lines.

 

Note: The input number n should be positive.

Example:

Input: N=4

Output: 1

5

25

125

625

B.  Write a program to display the following table

C. Write a program to display the numbers of a series 1, 4, 9, 16, 25,…..n by using for loop.

D. Write a program using the while loop, which prints the sum of every fi fth number from 0to 500 (including both 0 and 500).

Leave a Reply

Your email address will not be published.