#include <stdio.h>
main()
{
int x,n,result=1,i=1;
printf("\nEnter the value of x=");
scanf("%d",&x);
printf("\nEnter the value of n=");
scanf("%d",&n);
while(i<=n)
{
result=result*x;
i++;
}
printf("\n %d^%d=%d",x,n,result);
}
main()
{
int x,n,result=1,i=1;
printf("\nEnter the value of x=");
scanf("%d",&x);
printf("\nEnter the value of n=");
scanf("%d",&n);
while(i<=n)
{
result=result*x;
i++;
}
printf("\n %d^%d=%d",x,n,result);
}
No comments:
Post a Comment