#include <stdio.h>
#include <conio.h>
main()
{
int pr,cr,totalbill,consumption,reading;
clrscr();
printf("\n Welcome to the maynilad Water Consumption Bill Calculator");
printf("\n Enter Current Reading: ");scanf ("%d", &cr);
printf("\n Enter Previous Reading: ");scanf ("%d", &pr);
consumption=cr-pr;
if ((reading>1) && (reading<=50))
totalbill=consumption*3;
else if ((reading>50) && (reading<=100))
totalbill=150+(consumption-50)*4;
else if (reading>100)
totalbill=350+(consumption-100)*5;
elseif(reading<1)
[COLOR="Red"]printf("Invalid Value");[/COLOR]
[COLOR="Blue"]printf("The total Bill is %d", totalbill)[/COLOR]
getch();
}
The red text has an "statement missing ;" although I have an ;.
and the blue text, how could I seperate this printf from the else if statement.
I'm Practicing my C Programming, so I'm a little rusty now, having priorities on other program laguages.
Edited by WingedPanther, 24 July 2009 - 10:16 AM.
add code tags (the # button)


Sign In
Create Account

Back to top









