OK, I have figured out the answer to question 6-2. For anyone who wants to know here it is
Code:
#include <stdio.h>
char line[4];
int grade;
int main ()
{
printf ("What is the numeric grade: ");
fgets(line, sizeof(line), stdin);
sscanf(line, "%d", &grade);
if (grade <= 60)
printf("F\n");
if (grade >= 61)
while (grade <= 70)
{
printf("D\n");
break;
}
if (grade >= 71)
while (grade <= 80)
{
printf("C\n");
break;
}
if (grade >= 81)
while (grade <= 90)
{
printf("B\n");
break;
}
if (grade >= 91)
printf("A\n");
return(0);
}
I am still interested in knowing if there are answers on some website to the questions at the end of each chapter.