i got this program to work (yea!!!!!!), but i have 1 error... for some reason the last else clause is an 'illegal else with an if'... i looked at the book a bajillion times and i'm doing exactly what the model says in the book...
here's my code:
/* SEC5.3 EX 14 */
/* DATE: 07-23-02 */
#include <stdio.h>
int main()
{
int grade, one, two;
printf("Enter numerical grade: ");
scanf("%d", &grade);
if ( grade == 100 )
printf("Letter Grade: A\n");
else if ( 0<=grade && grade>=99 )
two = grade % 10;
one = grade / 10;
else
printf("ERROR\n");
printf("Letter Grade: ");
switch (one) {
case 0: case 1: case 2: case 3: case 4: case 5:
printf("F\n"); break;
case 6: printf("D\n");
break;
case 7: printf("C\n");
break;
case 8: printf("B\n");
break;
case 9: printf("A\n");
break;
}
return 0;
}