hi!
could you please help me in correcting the error I got in this program?
#include <stdio.h>
void main()
{
int c , f ,s;
printf("Enter the class in which the student is classified 1 , 2 or 3 ");
scanf("%d",&c );
switch(c)
{
case '1':
printf("Enter the status of failed subjects (>3),(<3)");
scanf("%d",&f );
switch(f)
{
case '>3':
printf("NO GRACE MARKS");
break;
case '<3':
printf("Enter the number of failed subjects 1,2 or 3");
scanf("d",&s);
break; } }
switch(s)
{
case '1':
printf("The grace marks to be given is 5");
break;
case '2':
printf("The grace marks to be given is 10");
break;
case '3':
printf("The grace marks to be given is 15");
break;
break; }
}
case '2': {
printf("Enter the status of failed subjects (>2) or (<2)");
scanf("%d",&f);}
{
switch(f)
case'>2':
printf("NO GRACE MARKS");
break;
case'<2':
printf("Enter the number of failed subjects 1 or 2");
scanf("%d",&s);
break;}
switch(s)
{
case '1':
printf("Grace marks to be awarded is 4");
break;
case '2':
printf("Grace marks to be awarded is 8");
break;
}
{
case '3':
printf("Enter the status of failed subjects >1 or =1");
scanf("%d",&f);}
{
switch(f);
case '>1':
printf("NO GRACE MARKS");
break;}
{case '=1':
printf("Grace marks to be awarded is 5");
break;}
default:
printf("INVALID INPUT");
}
p.s-the errors are:
1.unexpected } in the last line.
2.declaration terminated incorrectly in line 38