Salut camarade,
tu peux essaiyer ce code (~_~) !
**********************************************************************************************************
#include<stdio.h>
#include<stdlib.h>
int addition(int x, int y);
int soustraction(int x, int y);
int division(int x, int y);
int multiplication(int x, int y);
int main()
{
int color;
int resultat,a,x,y;
color = system (" color b" );
printf("\t\t\t*****************************************\n" );
printf("\t\t\t** MODE BASE **\n" );
printf("\t\t\t*****************************************\n\n\n" );
printf("\t\t\t****************MENU*********************\n" );
printf("\t\t\t* 0 Quitter *\n" );
printf("\t\t\t* 1 MULTIPLICATION *\n" );
printf("\t\t\t* 2 DIVISION *\n" );
printf("\t\t\t* 3 SOMME *\n" );
printf("\t\t\t* 4 SOUSTRACTION *\n" );
printf("\t\t\t*****************************************\n\n\n" );
printf("Entrer votre choix:" );
scanf("%d",&a);
if(a==3)
{
printf("\n\n****SOMME*****\n\n" );
printf("Entrer premier nombre :" );
scanf("%d",&x);
printf("Entrer second nombre :" );
scanf("%d",&y);
resultat=addition(x,y);
printf("%d + %d = %d\n",x,y, resultat);
}
if(a==4)
{
printf("\n\n****SOUSTRACTION*****\n\n" );
printf("Entrer premier nombre :" );
scanf("%d",&x);
printf("Entrer second nombre :" );
scanf("%d",&y);
resultat=soustraction(x,y);
printf("%d - %d = %d\n",x,y, resultat);
}
if(a==1)
{
printf("\n\n****MULTIPLICATION*****\n\n" );
printf("Entrer premier nombre :" );
scanf("%d",&x);
printf("Entrer second nombre :" );
scanf("%d",&y);
resultat=multiplication(x,y);
printf("%d * %d = %d\n",x,y, resultat);
}
if(a==2)
{
printf("\n\n****DIVISION*****\n\n" );
printf("Entrer premier nombre :" );
scanf("%d",&x);
printf("Entrer second nombre :" );
scanf("%d",&y);
resultat=division(x,y);
printf("%d / %d = %d\n",x,y, resultat);
}
return 0;
}
int addition(int x, int y)
{
int resultat;
resultat = x+y;
return resultat;
}
int soustraction(int x, int y)
{
int resultat;
resultat = x-y;
return resultat;
}
int division(int x, int y)
{
int resultat;
resultat = x/y;
return resultat;
}
int multiplication(int x, int y)
{
int resultat;
resultat = x*y;
return resultat;
}
**********************************************************************************************************