Home > Article > Backend Development > What is the cubic function in C language?
The function for finding the cubic power in C language is pow(), and its prototype is: double pow(double base, double exponent). Among them, exponent is fixed at 3, and base is the number to be raised to the third power.
Cubic function in C language
The function used to calculate cubic power in C language ispow(). Its prototype is as follows:
<code class="c">double pow(double base, double exponent);</code>
Where:
Usage:
To calculate the cube of a number, you can use the following syntax:
<code class="c">double cube = pow(number, 3);</code>
Where:
Example:
For example, to calculate the cube of 5, you would use the following code:
<code class="c">double cube = pow(5, 3); printf("5 的立方是:%f\n", cube);</code>
Output:
<code>5 的立方是:125.000000</code>
The above is the detailed content of What is the cubic function in C language?. For more information, please follow other related articles on the PHP Chinese website!