Calculating the nth power of x in C language can be implemented using the library functionpow. Function prototype: double pow(double x, double n).
The specific code is as follows:
#include#include int main( ) { printf("%f",pow(x,n)); return 0; }
Note: When using the pow function, the header file#include
Recommended learning:c language video tutorial
The above is the detailed content of How to write x raised to the yth power in c program. For more information, please follow other related articles on the PHP Chinese website!