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 |
Is map ordered c++?
What is the difference between global int and static int declaration?
What are separators in c++?
What is size of a object of following class? class Foo { public: void foo(){} }
What language is a dll written in?
What's c++ used for?
What is pair in c++?
How to access a variable of the structure?
Differentiate between C and C++.
Who invented turbo c++?
What is the difference between interpreters and compilers?
the maximum length of a character constant can be a) 2 b) 1 c) 8