Answer to Question #308232 in C for ahmed

Question #308232

Write a program to calculate the power of a number. The number and its power are input from user.


1
Expert's answer
2022-03-16T02:43:37-0400
#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));    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS