Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Determinar la hipotenusa de un triángulo rectángulo conocidas las longitudes de los catetos
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- int catetoA=0, catetoB=0;
- float hipotenusa=0;
- printf("Ingrese la longitud del cateto A: ");
- scanf("%d", &catetoA);
- printf("Ingrese la longitud del cateto B: ");
- scanf("%d", &catetoB);
- hipotenusa = sqrt(pow(catetoA, 2) + pow(catetoB, 2));
- printf("La hipotenusa del triangulo es: %f \n", hipotenusa);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment