Write a C++ Program to find Square Root of a number using sqrt() function.



Write a C++ Program to find Square Root of a number using sqrt() function...

Answer / 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

More C++ Interview Questions

What is a constructor initializer list?

0 Answers   Amazon,


dynamic scoping is

0 Answers   Siemens,


What is Copy Constructor?

5 Answers   ABC, Siemens,


How to input string in C++

0 Answers  


What are Agilent PRECOMPILERS?

0 Answers   Agilent,






What is partial specialization or template specialization?

0 Answers   Amazon,


Explain what happens when an exception is thrown in C++.

0 Answers   Amazon,


What is Coupling?

0 Answers   Cap Gemini,


What is latest update of C++ ?

0 Answers   Adobe,


Write a program to generate the Fibonocci Series in C++.

0 Answers   Accenture,


Mention the default functions in C++, how would you detect that error has occurred inside the constructor and destructor.

0 Answers   Adobe,


what is a pragma in C++?

0 Answers   Aspire,


Categories