Write a C++ Program to find Square Root of a number using sqrt() function.
Answer Posted / hr
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 |
Post New Answer View All Answers
What is the most common mistake on c++ and oo projects?
What is the use of vtable?
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.
What are the different scope C++ provide ?
What is #include cstdlib in c++?
What is set in c++?
Explain the differences between private, public and protected and give examples.
Can c++ be faster than c?
How do you clear a map in c++?
What are the implicit member functions of class?
Why do we use string in c++?
I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?
Can we change the basic meaning of an operator in c++?
Can user-defined object be declared as static data member of another class?
Define a constructor - what it is and how it might be called (2 methods)?