Home >Backend Development >C#.Net Tutorial >How to write x raised to the yth power in c program

How to write x raised to the yth power in c program

angryTom
angryTomOriginal
2020-02-12 17:28:4310192browse

How to write x raised to the yth power in c program

Calculating the nth power of x in C language can be implemented using the library function pow. Function prototype: double pow(double x, double n).

The specific code is as follows:

#include <stdio.h>
#include <math.h>
int main( ) 
{    
    printf("%f",pow(x,n));
    return 0;
}

Note: When using the pow function, the header file #include15dfdae10d7c0c52b8c9b87fff3f31d0 needs to be included in the source file.

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:what does mod mean in vbNext article:what does mod mean in vb