Home  >  Article  >  Backend Development  >  What does sqrt mean in C language?

What does sqrt mean in C language?

Guanhui
GuanhuiOriginal
2020-06-13 15:05:0229438browse

What does sqrt mean in C language?

#What does sqrt in C language mean?

In C language, sqrt means square root function. Its function is to calculate the square root of a non-negative real number. In the "math.h" file in VC6, the function prototype is "double sqrt (double number) ”, the input parameters of this function are not allowed to be negative.

Sample code

#include<math.h>

#include<stdio.h>

int main(void)
{
    double x = 4.0, result;

    result = sqrt(x);//result*result=x

    printf("Thesquarerootof%fis%f\n", x, result);

    return 0;
}

C language

C language is A general-purpose, procedurally oriented computer programming language. In 1972, Dennis Ritchie designed and developed the C language at Bell Telephone Laboratories in order to port and develop the UNIX operating system.

Recommended tutorial: "C#"

The above is the detailed content of What does sqrt mean in C language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn