How to use pow as exponentiation function in C

1 Answer

0 votes
#include <stdio.h>
#include <math.h>

int main() {
    double x = 5.0;

    printf("x^2: %.2f\n", pow(x, 2));

    return 0;
}




/*
run:

x^2: 25.00

*/

 



answered May 7, 2021 by avibootz

Related questions

1 answer 71 views
2 answers 131 views
1 answer 94 views
1 answer 183 views
1 answer 185 views
...