C hypot () - Biblioteca estándar de C

Tabla de contenido

La hipotenusa es el lado más largo de un triángulo rectángulo. La función hypot () se usa para encontrar hipotenusa cuando se proporcionan otros dos lados.

función hypot () Prototipo

 hipot doble (doble p, doble b);

h = √(p2+b2)en matemáticas es equivalente a programación h = hypot(p, b);en C.

La función hypot () se define en "> archivo de encabezado math.h.

Ejemplo: Función C hypot ()

 #include #include int main() ( double p, b; double hypotenuse; p = 5.0; b = 12.0; hypotenuse = hypot(p, b); printf("hypot(%.2lf, %.2lf) = %.2lf", p, b, hypotenuse); return 0; )

Salida

 hipot (5,00, 12,00) = 13,00

Articulos interesantes...