C++ program to print the square root. The cmath> header file in C++ provides a set of functions for performing mathematical operations, such as sqrt() for calculating the square root, log() for finding the natural logarithm of a number, and so on.

#include<iostream>

#include<math.h>

using namespace std;

int main()

{

float num, root;

cout << "Enter the num for sqrt";

cin >> num;

root = sqrt(num);

cout << "Square root of " << num << " is " << root;

return 0;

}

Output:

Enter the num for sqrt1500

Square root of 1500 is 38.7298

## What is math.h and how to implement in c++ program

You must include the header files math. h> and cmath> in order to utilise these functions. sin(double) double sin(double) sin(double) sin(double) sin(double) This function accepts an angle (in degrees) and returns its sine value, which can be confirmed using a sine curve. h is a header file in the C programming language’s standard library that is used to perform fundamental mathematical calculations. Integer-operating mathematical library functions, such as abs, labs, div, and ldiv, are instead supplied in the stdlib.

## What is SQRT function program in c++

One of the math and trigonometry functions is the SQRT function. It’s used to calculate a number’s square root. where x is a numeric value explicitly inputted or contained in the cell you’re referring to.

## Similar Programs

**Write a java program to print binary search program using while loop**

**Java program to print the ascending order using for loop**** **

**Descending order program in java using for loop**** **

**Java program to print the selection sort using array elements**

**Write a java program to create a singly linked list and display the element**

**Write a java program to merge three singly linked list elements**** **

**Java program to delete the linked list elements from a singly**

**Write a java program to count the linked list element in the nodes**

**Basic hello world program in java **

**Write a java program to print a number from the user**** **

**Java program to add two numbers taking input from user**** **

**Leap year or not program in java using if-else**** **

**Swapping of two numbers in java with temporary variable**** **

**Odd or even program in java using a mod operator**** **

**Vowel or consonant in java using if else**** **

**Java program to find largest of three numbers using nested if**** **

**Write a program to print first ten natural numbers in java**** **

**Write a program to find factorial of a number using for loop in java**** **