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 difference between object-oriented programming and procedural programming?
What is :: operator in c++?
Who invented oop?
What is abstraction in oop with example?
How do c++ struct differs from the c++ class?
What are c++ stream classes?
How is class defined?
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
what are the types of Member Functions?
What is fflush c++?
What do you mean by function overriding & function overloading in c++?
Can you write a function similar to printf()?
What are stacks?
Explain one method to process an entire string as one unit?