Write a C++ Program to find Square Root of a number using sqrt() function.
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 |
Explain the importance of method overloading in C++?
0 Answers Akamai Technologies, Infogain,
What is Copy Constructor?
What is a constructor initializer list?
Define an Abstract class in C++?
What are issues if we mix new and free in C++?
What is placement new?
When would you use a pointer? A reference?
What is the difference between member functions and static member functions?
What is function overloading and operator overloading in C++?
Write a C++ Program to Find whether given Number is Odd or Even.
How can you force the compiler to not generate them?
what is a pragma in C++?