Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- float a,b;
- int choix;
- printf("taper deux nombres: a b ");
- scanf("%f",&a);
- scanf("%f",&b);
- printf("Menu des operations\n 1.Addition\n 2.Soustraction\n 3.Multiplication\n 4.Division\n");
- scanf("%d", &choix);
- switch(choix){
- case 1 : printf("choix: Addition\n");
- printf("%f+%f=%f\n",a,b,a+b);
- break;
- case 2 : printf("choix: Soustraction\n");
- printf("%f-%f=%f\n",a,b,a-b);
- break;
- case 3 : printf("choix: Multiplication\n");
- printf("%fĂ%f=%f\n",a,b,a*b);
- break;
- case 4 : printf("choix: Division\n");
- printf("%f/%f=%f\n",a,b,a/b);
- break;
- default : printf("Pas un choix valide");
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement