Smipple is shutting down Nov 30, 2017. Some features are currently disabled.
Profile image for Alex Jose Silva alexjosesilva
URI ONLINE
Language
C
Tags
C URI

11342

1 #include <stdio.h> 2 3 int main() { 4 5 6 int num,contA=0,contG=0,contD=0; 7 8 do{ 9 scanf("%i",&num); 10 if(num==1){contA++;} 11 else if(num==2){contG++;} 12 else if(num==3){contD++;} 13 }while(num!=4); 14 15 printf("Álcool: %i\n",contA); 16 printf("Gasolina: %i\n",contG); 17 printf("Diesel: %i\n",contD); 18 19 return 0; 20 }

Comments