Iterative method
#include<stdio.h>
int main()
{
double x,y,i;
scanf("%d%d",&x,&y);
for(i=1;i<y;i++)
x=x*x;
printf("%d",x);
return 0;
}
Recursive Method
#include<stdio.h>
int pow(int x,int y)
{
if(y==1)
return x;
else
return x*pow(x,--y);
}
int main()
{
int x,y;
scanf("%d%d",&x,&y);
x=pow(x,y);
printf("%d",x);
return 0;
}