Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int a,b,d;
- char c;
- printf("entrez la valeur de a : \n");
- scanf("%d", &a);
- printf("entrez la valeur de b : \n");
- scanf("%d", &b);
- printf("entrez l'operateur: \n");
- scanf("%c", &c);
- switch (c)
- {
- case '+':
- d = a + b;
- break;
- case '-':
- d = a-b;
- break;
- case '*':
- d = a *b ;
- break;
- case '/':
- d = a/b;
- break;
- }
- printf("le resultat est egal a : %d", d);
- return 0;
- }
Add Comment
Please, Sign In to add comment