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 are the advantages/disadvantages of using inline and const?
Is deconstructor overloading possible? If yes then explain and if no Then why?
What are "pure virtual" functions?
0 Answers Adobe, Alter, iNautix,
What is data abstraction? How is it implemented in C++?
Explain function prototypes in C++.
What is Coupling?
What is wrong with this statement? std::auto_ptr ptr(new char[10]);
Define type casting in C++.
What are issues if we mix new and free in C++?
What is name mangling/name decoration?
Explain about Searching and sorting algorithms with complexities
What do you by Function Overloading in C++?
0 Answers Akamai Technologies, Infogain,