Learn about C Program to Find Grade of Student using nested if-else statements in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.
C Program to Find Grade of Student using nested if-else statements
Program:
#include<stdio.h>
int main()
{
int score;
printf("Enter score( 0-100 ): ");
scanf("%d",&score);
if(score>=90 )
printf("Grade: A");
else if(score>=80 )
printf("Grade: B");
else if(score>=70)
printf("Grade: C");
else if(score>=60)
printf("Grade: D");
else if(score>=50)
printf("Grade: E");
else
printf("Grade: F");
return 0;
}
Output:
Enter score( 0-100 ): 76
Grade: C
Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.
Similar Codes :
Hello World Program in C
C Program to Find Grade of Student Using Switch Statement