Sunday, 3 April 2016

Cube Root of Number in C++

Cube Root of Number in C++

Hello friend today we will learn about how to write program of Cube Root of Number in C++. This is very simple we can use predefined method cbrt() of header file math.h

Code for find cube root of number

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int num;
cout<<"Enter any number:";
cin>>num;
float cbroot =cbrt(n));
cout<<"Cube Root: "<<cbroot;
}

Output:

Enter any number: 3
Cube Root: 27

No comments:

Post a Comment