In this tutorial, we are going to make a C Program to Print the Power of a given Number with practical program code and a step-by-step full complete explanation.

C Program to Print Power of given Number


Program to Print Power of given Number.

#include<stdio.h>
#include<conio.h>
Void main()
{
     Int a,b,result=1,i;

printf(“Enter value of a:”);
scanf(“%d”,&a);
printf(“Enter value of b:”);
scanf(“%d”,&b);

for(i=1; i<=b; i++)
result=result*a;

printf(“%d power %d =%d, a,b,result);
getch();
}

Output

C Program to Print Power of given Number