C++ Program to find Square root of a number

      No Comments on C++ Program to find Square root of a number

sqrt() is predefined function in math.h header file. It is used to calculate square root of a number.

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int x;
float y;
cout<<"Enter Number:-"<<endl;
cin>>x;
y=sqrt(x);
cout<<"Square root of a number is: "<<y;
getch();
}

OUTPUT:-

Leave a Reply

Your email address will not be published. Required fields are marked *