Created
January 4, 2018 13:40
-
-
Save vikychoi/a1a6194ac05b25d7904de34988fcdeee to your computer and use it in GitHub Desktop.
C for power calculation
This file contains 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> | |
main() | |
{ | |
printf("input x\n"); | |
int x; | |
scanf("%d", &x); | |
printf("input y\n"); | |
int y; | |
scanf("%d",&y); | |
int i; | |
int z; | |
z = x; | |
for(i = 1; i<y; i++) | |
{ | |
z = z * x; | |
} | |
printf("%d", z); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment