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 kind of problems does name mangling cause?
Briefly explain various access specifiers in C++.
Explain about Searching and sorting algorithms with complexities
Write a C++ Program to find Square Root of a number using sqrt() function.
What Are The Differences Between A C++ Struct And C++ Class?
How to input string in C++
What is the difference between Stack and Queue in C++?
0 Answers Global Logic, iNautix,
What is placement new?
Declare a pointer to a function that takes a char pointer as argument and returns a void pointer.
In C++ what do you mean by Inheritance?
How can a C function be called in a C++ program?
What is the meaning of the following declaration: int *const *const *i?