C Online Compiler
Example: C Program to Find Power of a Number using pow() Function
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// C Program to Find Power of a Number using pow() Function #include <stdio.h> #include <math.h> // It's the driver function int main() { double b, x, r; // b - Base value, x - Exponent value, r - Result value printf("INPUT Base Number:: "); scanf("%lf", &b); printf("\nINPUT Exponent Number:: "); scanf("%lf", &x); // It will calculate the power of the base number r = (double) pow(b, x); // It will print the final output printf("\n\nOUTPUT:: %lf ^ %lf = %lf\n", b, x, r); return 0; }
4.6 3
Output
Clear
ADVERTISEMENTS