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 does free know the size of memory to be deleted
Tell How To Check Whether A Linked List Is Circular ?
dynamic scoping is
what is a pragma in C++?
What is the difference between malloc, calloc and realloc?
Write a program to read two numbers from the keyboard and display the larger value on the screen
what is the difference between a pointer and a reference?
0 Answers Amazon, Blue Star, C DAC,
explain the term 'resource acquisition is initialization'?
How can a C function be called in a C++ program?
Write a program to read the values a, b and c and display x, where x=a/b–c. Test the program for the following values: (a) a = 250, b = 85, c = 25 (b) a = 300, b = 70, c = 70
Explain function prototypes in C++.
Explain what happens when an exception is thrown in C++.