Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- float x, y;
- int z;
- printf("Digite primeiro numero:");
- scanf("%f", &x);
- printf("nDigite segundo numero:");
- scanf("%f", &y);
- printf("nDigite a operação que deseja fazern");
- printf("n(1)Soma; (2)Subtração; (3)Multiplicação; (4)Divisãon");
- scanf("%d", &z);
- switch(z){
- case 1:
- printf("%2.f", x + y);
- break;
- case 2:
- printf("%2.f", x - y);
- break;
- case 3:
- printf("%2.f", x * y);
- break;
- case 4:
- printf("%2.f", x / y);
- break;
- default:
- printf("Número Inválido");
- break;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment