Advertisement
FabioHouse

Untitled

Dec 6th, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int media(int a, int b){
  5. int c;
  6. c=somma(a,b);
  7. c= c / 2;
  8. return c;
  9. }
  10.  
  11. int somma(int a, int b){
  12. int c;
  13. c = a + b;
  14. return c;
  15. }
  16.  
  17. int maggiore(int a, int b){
  18. int c;
  19. if(a<b)
  20. c = b;
  21. else
  22. c = a;
  23. return c;
  24. }
  25.  
  26. int main()
  27. {
  28. int num1,num2,med,som,mag;
  29. printf("Scrivi 2 numeri interi \n");
  30. scanf("%d",&num1);
  31. scanf("%d",&num2);
  32. med=media(num1,num2);
  33. som=somma(num1,num2);
  34. mag=maggiore(num1,num2);
  35. printf("La media di: %d e %d non e' altro che: %d \n",num1,num2,med);
  36. printf("La somma di: %d e %d non e' altro che: %d \n",num1,num2,som);
  37. printf("Il maggiore tra: %d e %d non e' altro che: %d \n",num1,num2,mag);
  38. system("PAUSE");
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement