424,972 Members | 901 Online
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

# print currentprice, upcomingprice and the difference

 P: 1 Expand|Select|Wrap|Line Numbers #include  int main(void) { int currentprice,upcomingprice; int currentprice1,currentprice2,currentprice3; int upcomingprice1,upcomingprice2,upcomingprice3; int difference; float gallons; printf( "Enter the water consumption \n ", gallons );     scanf( "%f", &gallons);   switch(currentprice){       case 1:       currentprice1=gallons*7;       break;       case 2:       currentprice2=gallons*9;       break;       case 3:       currentprice3=gallons*11;       break; } switch(upcomingprice) {       case 4:       upcomingprice1=gallons*6;       break;       case 5:       upcomingprice2=gallons*9;       break;       case 6:       upcomingprice3=gallons*13;       break;       }   while (0<=gallons<=100000) {         currentprice1=gallons*7;             break; } while (100000=500000) {         currentprice3=gallons*11;             break; } while (gallons <= 50000) {         upcomingprice1=gallons*6;             break; } while (50000