Created
August 10, 2017 17:24
-
-
Save echo-akash/62d627fea44370ad878a725250a695d4 to your computer and use it in GitHub Desktop.
Print the value of X^N.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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