C Program to calculate the power of the given number
#include<conio.h>
void power();
void main()
{
clrscr();
power();
getch();
}
void power()
{
int n,p,Result=1;
printf("Enter number and Power\n");
scanf("%d %d",&n,&p);
while(p!=0)
{
Result=Result*n;
p--;
}
printf("%d",Result);
}
OUTPUT
Enter number and Power2
8
256
------------------------------------------------------------------------------------------------------------
You can also visit:-