In this program, we are going to share a c program code for pow. If you are a beginner and want to start learning the C programming, then keep your close attention in this tutorial as I am going to share a c program code for pow with the output.
Copy below c program and execute it with c compiler to see the output of the program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <stdio.h> #include <math.h> int main() { double c, d, result; printf("Enter c and d to calculate c^d\n"); scanf("%lf%lf", &c, &d); result = pow(c, d); printf("%.2lf raised to %.2lf = %.2lf\n", c, d, result); return 0; } |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.