#include<stdio.h>
long power(int x,int n)
{
int p;
for(p=1;n>0;n--){
p*=x;
}
return p;
}
main()
{
int x,n;
printf("Enter x and n:");
scanf("%d%d",&x,&n);
printf("x power n is %ld",power(x,n));
}
#include<stdio.h>
long power(int x,int n)
{
int p;
for(p=1;n>0;n--){
p*=x;
}
return p;
}
main()
{
int x,n;
printf("Enter x and n:");
scanf("%d%d",&x,&n);
printf("x power n is %ld",power(x,n));
}