# Cube of numberr in C++ by R4R Team

For finding the cube of any number, we have many method but some methods are:

1.
number=3;
answer=number*number*number;

2.
number=3;
answer=pow(number,3);

-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.

program-

#include < stdio.h>
#include< math.h>
int main()
{
int n,a;
cout<<"Enter numbern"< cin>>n;
a=pow(n,3);
cout<<"Cube is: "< }

output-

Enter number
2
Cube of 2 is 8

Enter number
5
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.

##### R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!