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 is the use of data hiding?
Difference between overloading vs. Overriding
Describe private, protected and public?
What is wrapper class in c++?
What is scope in c++ with example?
How to call a non virtual function in the derived class by using base class pointer
What is the use of cmath in c++?
What does the ios::ate argument do?
why and when we can declar member fuction as a private in the class?
Does std endl flush?
What is the use of pointer in c++ with example?
How the keyword struct is different from the keyword class in c++?
Does c++ have a hash table?
What's c++ used for?
How would you use the functions memcpy(), memset(), memmove()?