Fixed this code for you:
Code:
#include <stdio.h>
int main(void)
{
int c, t;
printf("Enter the number of subjects he has failed in: ");
scanf("%d%d", &c, &t);
switch(c)
{
case 1:
switch(t>3)
{
case 1:
printf("\nNo grace");
break;
case 0:
printf("\nGrace of 5 marks per subject");
break;
}
break;
case 2:
switch(t>2)
{
case 1:
printf("\nNo grace");
break;
case 0:
printf("\nGrace of 5 marks per subject");
break;
}
break;
case 3:
switch(t>1)
{
case 1:
printf("\nNo grace");
break;
case 0:
printf("\nGrace of 5 marks per subject");
break;
}
break;
}
}
Now what exactly is the problem?
Bookmarks