Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int code,amount;
- float total;
- printf("Insira o codigo do produto :\n"); scanf("%d",&code);
- printf("Insira a quantidade a ser adquirida :\n"); scanf("%d",&amount);
- switch(code)
- {
- case 1001:
- total = amount*5.32; printf("TOTAL = %f\n",total); break;
- case 1324:
- total = amount*6.45; printf("TOTAL = %f\n",total); break;
- case 6548:
- total = amount*2.37; printf("TOTAL = %f\n",total); break;
- case 987:
- total = amount*5.32; printf("TOTAL = %f\n",total); break;
- case 7623:
- total = amount*6.45; printf("TOTAL = %f\n",total); break;
- default: printf("CODIGO INVALIDO!\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment