Hi Dweeler,
The problem is this area:
Code:
int getBill (char x)
{
if (x!='C' || x!='H')
return 2;
if (x!='c' || x!='h')
return 2;
if (x=='c' || x=='C')
return 1;
if (x=='h' || x=='H')
return 0;
}
If you modify the code like this:
Code:
int getBill (char x)
{
if(x == 'c' || x == 'C')
return 0;
else if (x == 'h' || x == 'H')
return 1;
else
return 2;
}
then the code would run better.
Can you understand where have you made the error?
Regards,
Paramesh.