For finding the cube of any number, we have many method but some methods are:
-Here we find the cube of the number by the pow() function that are predefined in math library.
-We pass two argument in this function, first arguement is number and second argument is power.
#include < stdio.h>
cout<<"Cube is: "<
Cube of 2 is 8
Cube of 5 is 125
-In this program, we include the math library by #include< math.h> so that pow()
function do not give any kind of error.
- we take an input of the number and pass in pow(n,3)
which return the cube of the number.