Advertisement
Ferdinando_Ottaviani

esercizio 2

Oct 16th, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. int main (void){
  5. int x,y,max,min;
  6. float z,med;
  7. printf("immetti 3 interi\n");
  8. scanf("%d%d%f",&x,&y,&z);
  9. if (x>y)
  10. max=x;
  11. else
  12. max=y;
  13. if (max<z)
  14. max=z;
  15. if (x<y)
  16. min=x;
  17. else
  18. min=y;
  19. if (z<min)
  20. min=z;
  21. med=(x+y+z)/3;
  22. printf("il max e'%d\n",max);
  23. printf("il min e'%d\n", min);
  24. printf("la media e'%f\n", med);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement