DESCRIPTION-:This program calculates the square root of the entered number.It may be sure that the value of entered number should be greater than the 0.As the value of square root for negative number is "imaginary".
FOR EXAMPLE-: If we enter element as------------
64
Then program generate output-------------
square root=8
PROGRAM-:
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int a;
float squareroot,cuberoot;
cout<<"enter the number";
cin>>a;
cout<<"\n"<<"square root of the number is" ;
squareroot=sqrt(a);
cout<<squareroot;
getch();
}
FOR EXAMPLE-: If we enter element as------------
64
Then program generate output-------------
square root=8
PROGRAM-:
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int a;
float squareroot,cuberoot;
cout<<"enter the number";
cin>>a;
cout<<"\n"<<"square root of the number is" ;
squareroot=sqrt(a);
cout<<squareroot;
getch();
}
0 comments:
Post a Comment