Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>hypot</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
hypot

Usage

   #include <math.h>
   double hypot(double x,double y);

Description

   Calculates the length of the hypotenuse of a right-angled triangle with
   sides of length x and y. The hypotenuse is the value obtained by taking
   the square root of the sums of the squares of x and y (sqrt(x*x+y*y)).

Example 

   #include <stdio.h>
   #include <math.h>
   #include <stdlib.h>

   int main()
   {
       double x,y;
       printf("Enter floating point x: ");
       scanf("%lf",&x);
       printf("Enter floating point y: ");
       fflush(stdin);
       scanf("%lf",&y);
       printf("The hypotenuse of [%lf, %lf] is ",x,y);
       printf("[%lf]\n",hypot(x,y));
       return EXIT_SUCCESS;
   }

Return Value

   The hypotenuse of a right-angled triangle with sides x and y.






Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson