Program for Square Root in C++

Program for Square Root in C++

#include<iostream>
#include<math.h>
 
using namespace std;
 
int main()
{
	float sq,n;
	cout<<"Enter any number:";
	cin>>n;
	sq=sqrt(n);
	cout<<"Square root of "<<n<<" is "<<sq;
	return 0;
}

Output

Enter any number:9

Square root of 9 is 3

Leave a Comment

error: Alert: Content is protected!!