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 |
What is Boyce Codd Normal form?
What is conversion constructor in C++
What is name mangling/name decoration?
In C++ what do you mean by Inheritance?
When would you use a pointer? A reference?
What is C++11?
How many times will this loop execute? Explain your answer.
What is pass by value & reference.
Tell me about virtual function
Explain why C++ is not purely Object Oriented Language
What Are The Differences Between A C++ Struct And C++ Class?
explain the term 'resource acquisition is initialization'?