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

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 create a multiplication table of a given number using while loop.

Program to find equal values using if statement in C++