Advertisement
gonzalob

Untitled

Mar 21st, 2022
894
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. #define PI 3.14
  6.  
  7. int main()
  8. {
  9.      int catetoUno;
  10.     int catetoDos;
  11.  
  12.     int hipotenusa;
  13.  
  14.     int radio;
  15.     int areaCirculo;
  16.  
  17.      //esto no se ejecuta
  18.     printf("ingresa un catetoUno \n");
  19.     fflush(stdin);
  20.     scanf("%d",&catetoUno);
  21.  
  22.     printf("ingresa catetoDos \n");
  23.     //limpiar el buffer
  24.     fflush(stdin);
  25.     scanf("%d",&catetoDos);
  26.  
  27.     hipotenusa = sqrt( pow(catetoUno,2)+pow(catetoDos,2) );
  28.  
  29.     printf("la hipo es %d\n",hipotenusa);
  30.  
  31.  
  32.     printf("ingresa radio \n");
  33.     //limpiar el buffer
  34.     fflush(stdin);
  35.     scanf("%d",&radio);
  36.  
  37.     areaCirculo = PI * radio * radio;
  38.  
  39.         printf("el areaCirculo es %d\n",areaCirculo);
  40.  
  41.  
  42.     return 0;
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement