I'm working on my very 1st assignment and i just don't get it where i got my program wrong.I wrote the following program and when it comes to the last part,it's confusing.When the output is n,the program ends but when the input is y,it does not loop back into the switch part.Anyone??
int h,m;
float charge;
char a,d;
while (d!='n')
{
printf("B for Bus\n");
printf("C for Car\n");
printf("Vehicle type:");
scanf("%c",&a);
switch (a)
{
case 'B':
do
{ printf("Parking duration <hour>:");
scanf("%d",&h);
}while (h<0);