C program to check whether a student is pass or fail

[c]
#include
#include
void main()
{
int percentage;
clrscr();
printf(“Enter Your Percentage: “);
scanf(“%d”,&percentage);
if(percentage<0 || percentage>100)
{
printf(“Wrong Entry”);
}
else if(percentage<40) { printf("Grade F \nSorry You're Fail! "); } else if(percentage>=40 && percentage<60) { printf("Grade D"); } else if(percentage>=60 && percentage<70) { printf("Grade C"); } else if(percentage>=70 && percentage<80) { printf("Grade B"); } else if(percentage>=80 && percentage<90) { printf("Grade A"); } else { printf("Grade E \nYou're Excellent!"); } getch(); } [/c] Output-1:

C program to check whether a student is pass or fail

Output-2:

C program to check whether a student is pass or fail

Leave a Reply

Your email address will not be published. Required fields are marked *