Sisi miring adalah sisi terpanjang dari segitiga siku-siku. Fungsi hipotenusa () digunakan untuk mencari sisi miring ketika dua sisi lainnya disediakan.
Prototipe fungsi hypot ()
hipot ganda (p ganda, b ganda);
h = √(p2+b2)
dalam matematika setara dengan h = hypot(p, b);
dalam Pemrograman C.
Fungsi hypot () didefinisikan dalam file header "> math.h.
Contoh: Fungsi 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; )
Keluaran
hipot (5.00, 12.00) = 13.00