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.
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 power of b:");
scanf("%d",&b);
for(i=1; i<=b; i++)
result=result*a;
printf("%d power %d =%d", a,b,result);
getch();
}