Program to take square root of a number.

Using Visual Studio 2015


==============================================================


#include<iostream>
using namespace std;
#include<conio.h>
#include<math.h>

void main()
{

float num;

cout<<"Enter number=";

cin>>num;

cout<<sqrt(num);

_getche();
}

=========================================================================

It's a simple program to take a square root of a number. For this program we take an additional header file '#include<math.h>'. We take a special keyword for this too 'sqrt' and then enter the number in the brackets.

Comments

Popular posts from this blog

Program to calculate the number of days from the beginning of the year to a date specified by the user through array in C++

Suppose you are given a square matrix of size n x n, write a program to determine if this is an identity matrix. 2D array

Program to calculate the sum of first 100 even numbers using while loop