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 |
Tell How To Check Whether A Linked List Is Circular ?
What are the advantages/disadvantages of using inline and const?
Explain about Searching and sorting algorithms with complexities
What is a class in C++?
1 Answers Amazon, TCS, UGC Corporation,
What is data abstraction? How is it implemented in C++?
Can we call C++ OOPS? and Why
If class D is derived from a base class B
What are the fundamental features of an object-oriented language?
Define type casting in C++.
Identify the error in the following program. include<iostream> using namespace std; void main() { int num[]={1,2,3,4,5,6}; num[1]==[1]num ? cout<<"Success" : cout<<"Error"; }
Explain the difference between C and C++.
How many times will this loop execute? Explain your answer.