basic-c/sources/power.c

17 lines
405 B
C
Raw Permalink Normal View History

#include<stdio.h>
int main(int argc, char *argv[]) {
int i;
int base;
int significative;
int result = 1;
printf("Enter base: ");
scanf("%d", &base);
printf("Enter significative: ");
scanf("%d", &significative);
for (i = 0; i < significative; i++) {
result *= base;
}
printf("%d powered by %d is %d \n", base, significative, result);
}