Can we use more than one 'if' subroutine in one program.
I am trying to implement this but if I run the two subroutines at the same time the lower subroutine directly shows "invalid grade". But if I run one at a time then they work perfectly fine.
Why is this happening? Does the compiler think that its the same "if" routine. If so how do I segregate it???
Code:printf("Enter a score:"); scanf("%d",&gr); if(gr>=80 && gr<=100) printf("A Grade\n"); if (gr>=60 && gr<80) printf("B Grade\n"); if (gr>=40 && gr<60) printf("C Grade\n"); if (gr>=20 && gr<40) printf("D Grade\n"); if (gr<20) printf("E Grade\n"); if(gr<0 && gr>100) printf("invalid\n\n"); printf("Enter a grade:\n"); scanf("%c",&gre); if(gre=='A') printf("Range: 80 to 100 \n"); if (gre=='B') printf("Range: 60 to 79 \n"); if (gre=='C') printf("Range: 40 to 59\n"); if (gre=='D') printf("Range: 20 to 39\n"); if (gre=='E') printf("Range: 0 to 19\n"); if (gre!='A'&& gre!='B'&& gre!='C'&& gre!='D'&& gre!='E') printf("invalid grade\n\n");