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
How the virtual functions maintain the call up?
Are polymorphisms mutations?
Can we have inheritance without polymorphism?
What is a function in oop?
What is ios flag in c++?
Write some differences between an external iterator and an internal iterator?
What is a singleton c++?
Is it possible to use a new for the reallocation of pointers ?
How Do you Code Composition and Aggregation in C++ ?
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
What are the two shift operators and what are their functions?
Why is polymorphism needed?
How can you quickly find the number of elements stored in a static array?
What operators can you overload in c++?
What do you mean by abstraction?