In the following program, what additional syntax is needed to ensure that two pr
ID: 3768490 • Letter: I
Question
In the following program, what additional syntax is needed to ensure that two printf statements in the if structure shown will be executed when the condition is false (i.e., when grade < 60). Please make the change right in the code itself.
#include <stdio.h>
void main (void)
{
int grade;
printf ("Enter student grade: ");
scanf ("%i", &grade);
if (grade > 100)
printf ("Invalid Grade. ");
printf ("Please Re-enter ");
else if (grade < 0)
printf ("Too Low! ");
printf ("Enter it again!");
}
Explanation / Answer
if (!(grade > 100))
{
printf ("Invalid Grade. ");
printf ("Please Re-enter ");
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.