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 |
How to input string in C++
Write a program that ask for user input from 5 to 9 then calculate the average
What are issues if we mix new and free in C++?
How does stack look in function calls? Write a recursive function call, how will the stack look like?
CDPATH shell variable is in(c-shell)
When would you use a pointer? A reference?
Write a syntax and purpose of switch statement.
What is the meaning of the following declaration: int *const *const *i?
How will you print a list of all unique words from a string which may contain repeated words?
Difference between Call by pointer and by reference.
Can we call a virtual function from a constructor?
What are the advantages/disadvantages of using inline and const?