C program to calculate power of a given number ! Calculator power of a given number c programming

preview_player
Показать описание
C program to calculate power of a given number ! Calculator power of a given number c program

Take two integers from the user for base and exponent and calculate the power as explained below.

Example
Consider the following for writing a C program.

Suppose base =3
Exponent = 4
Power=3*3*3*3
Algorithm
Follow the algorithm given below −

Step 1: Declare int and long variables.
Step 2: Enter base value through console.
Step 3: Enter exponent value through console.
Step 4: While loop.
Exponent !=0
i. Value *=base
ii. –exponent
Step 5: Print the result.

#codingtutorial
#cprogramming
#cprogrammingquestions
Рекомендации по теме
welcome to shbcf.ru