double hypot (double x , double y); float hypot (float x , float y); long double hypot (long double x, long double y); double hypot (Type1 x , Type2 y); // additional overloads
حساب الوتر في المثلث القائم الزاوية حسب نظرية فيتاغورس
/* hypot example */ #include <stdio.h> /* printf */ #include <math.h> /* hypot */ int main () { double leg_x, leg_y, result; leg_x = 3; leg_y = 4; result = hypot (leg_x, leg_y); printf ("%f, %f and %f form a right-angled triangle.\n",leg_x,leg_y,result); return 0; }
3.000000, 4.000000 and 5.000000 form a right-angled triangle.