#include<stdio.h>
int main( )
{
int n, pow, i, j=1;
printf("Enter the number and its power");
scanf("%d %d",&n,&pow);
if(pow==0)
printf("Result is 1");
for(i=1; i<=pow; i++)
{
j=j*n;
}
if(pow>0)
printf("Result is %d",j);
return 0;
}
int main( )
{
int n, pow, i, j=1;
printf("Enter the number and its power");
scanf("%d %d",&n,&pow);
if(pow==0)
printf("Result is 1");
for(i=1; i<=pow; i++)
{
j=j*n;
}
if(pow>0)
printf("Result is %d",j);
return 0;
}
0 Comments