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 |
Write a program to generate the Fibonocci Series in C++.
What Are The Differences Between A C++ Struct And C++ Class?
Describe the different styles of function prototypes in C++.
How to invoke a C function using a C++ program?
Define an Abstract class in C++?
Write a C++ Program to Find Sum and Average of three numbers.
What are the fundamental features of an object-oriented language?
Name the operators that cannot be overloaded.
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"; }
C++ supports multiple inheritance. What is the “diamond problem” that can occur with multiple inheritance? Give an example.
what is a pragma in C++?
What is a COPY CONSTRUCTOR and when is it called?