#include <stdio.h>
#include <stdlib.h>
int A,B,res;
char choix,n;
int main()
{
printf("* (+)Addition *\n");
printf("* (*)Multiplication *\n");
printf("* (/)Division *\n");
printf("Entrez le 1er nbre:\n");
scanf("%d",&A);
printf("Entrez le 2eme nbre:\n");
scanf("%d",&B);
printf("Entrez votre choix:\n");
scanf("%s",&choix);
switch (choix)
{
case '+':
res=(A+B);
printf("addition est :\n %.2d\n",res);
break;
case '*':
res=(A*B);
printf("multiplicaiotn est :\n %.2d\n",res);
break;
case '/':
if (B==0)
{
printf("B doit etre <> 0\n\n");
}
else
res=(A/B);
printf("division est :\n %.2d\n",res);
break;
default:
printf("Votre choix n'existe pas\n\n");
break;
}
system("PAUSE");
return 0;
}تم تعديل هذه المشاركة بواسطة مونية في 29 أكتوبر 2010 في 00:20