Program to take square root of a number.
Using Visual Studio 2015
==============================================================
using namespace std;
#include<conio.h>
#include<math.h>
void main()
{
float num;
cout<<"Enter number=";
cin>>num;
cout<<sqrt(num);
_getche();
}
=========================================================================
It's a simple program to take a square root of a number. For this program we take an additional header file '#include<math.h>'. We take a special keyword for this too 'sqrt' and then enter the number in the brackets.
Comments
Post a Comment