Skip to content

Instantly share code, notes, and snippets.

@echo-akash
Created August 10, 2017 17:24
Show Gist options
  • Save echo-akash/62d627fea44370ad878a725250a695d4 to your computer and use it in GitHub Desktop.
Save echo-akash/62d627fea44370ad878a725250a695d4 to your computer and use it in GitHub Desktop.
Print the value of X^N.
#include<stdio.h>
int main()
{
int p,n,i,x;
p=1;
printf("enter value of X:");
scanf("%d",&x);
printf("enter value of N:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
p=p*x;
}
printf("value of %d^%d=%d",x,n,p);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment