To write a C program to display the remarks for the grade using simple if statement
1: Start the program.
2: Read a character (c) from the user.
3: Check the value of c using conditional statements:
a) If c is equal to 'A', print "Excellent!!". b) If c is equal to 'B', print "Good!!". c) If none of the conditions above are met, the program will end without printing anything.
Step 4: Stop the program.
#include <stdio.h>
int main()
{
char c;
scanf("%c",&c);
if(c=='A')
{
printf("Excellent!!");
}
else if(c=='B')
{
printf("Good!!");
}
}
Thus, the program is successfully verified.