TheMalva

Ejercicio_10

Apr 22nd, 2015
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. //Determinar la hipotenusa de un triángulo rectángulo conocidas las longitudes de los catetos
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <math.h>
  6.  
  7. int main()
  8. {
  9.     int catetoA=0, catetoB=0;
  10.     float hipotenusa=0;
  11.     printf("Ingrese la longitud del cateto A: ");
  12.     scanf("%d", &catetoA);
  13.     printf("Ingrese la longitud del cateto B: ");
  14.     scanf("%d", &catetoB);
  15.     hipotenusa = sqrt(pow(catetoA, 2) + pow(catetoB, 2));
  16.     printf("La hipotenusa del triangulo es: %f \n", hipotenusa);
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment