Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int media(int a, int b){
- int c;
- c=somma(a,b);
- c= c / 2;
- return c;
- }
- int somma(int a, int b){
- int c;
- c = a + b;
- return c;
- }
- int maggiore(int a, int b){
- int c;
- if(a<b)
- c = b;
- else
- c = a;
- return c;
- }
- int main()
- {
- int num1,num2,med,som,mag;
- printf("Scrivi 2 numeri interi \n");
- scanf("%d",&num1);
- scanf("%d",&num2);
- med=media(num1,num2);
- som=somma(num1,num2);
- mag=maggiore(num1,num2);
- printf("La media di: %d e %d non e' altro che: %d \n",num1,num2,med);
- printf("La somma di: %d e %d non e' altro che: %d \n",num1,num2,som);
- printf("Il maggiore tra: %d e %d non e' altro che: %d \n",num1,num2,mag);
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement