Write a C++ Program to find Square Root of a number using sqrt() function.
Answer Posted / hr
Solution:
/* C++ Program to find Square Root of a number using sqrt() function */
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
float sq,n;
cout<<"Enter any positive number :: ";
cin>>n;
sq=sqrt(n);
cout<<"
Square root of Entered Number [ "<<n<<" ] is :: "<<sq<<"
";
return 0;
}
Output:
/* C++ Program to find SquareRoot of a number using sqrt() function */
Enter any positive number :: 10000
Square root of Entered Number [ 10000 ] is :: 100
Process returned 0
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the various types of stl containers?
What is an adaptor class in c++?
What is the real purpose of class – to export data?
Explain class invariant.
#include
Explain how overloading takes place in c++?
What is a set in c++?
What problems might the following macro bring to the application?
What is the difference between a constructor and a destructor?
List the features of oops in c++?
Where and why do I have to put the "template" and "typename" keywords?
What is difference between c++ 11 and c++ 14?
What kind of problems can be solved by a namespace?
What is the use of setfill in c++?
Explain operator overloading.