Write a program to calculate the power of a number. The number and its power are input from user.
#include <stdio.h>
#include <math.h>
int main() {
int number, power;
printf("Enter number: ");
scanf("%d", &number);
printf("Enter power: ");
scanf("%d", &power);
printf("\n\n");
printf("Result: %.2f\n", pow(number, power));
}
Comments
Leave a comment