j

Wednesday, 25 November 2015

Write a program that take grade A,B,C and D if user enter A then Display Exelent if enter B then Good if Enter C Average and if Enter D then Display Poor

Program

#include<stdio.h>
#include<conio.h>
void main()
{
char grd;
printf("Enter grade A,B,C or D...");
grd=getche();
if(grd=='a'||grd=='A')
printf("\nEXCELENT");
else if(grd=='B'||grd=='b')
printf("\nGOOD");
else if(grd=='c'||grd=='C')
printf("\nAVERAGE");
else if(grd=='d'||grd=='D')
printf("\nPOOR");
else
printf("\nINVALID GRADE");
getch();
}


Output

 

Subscribe to this Blog via Email :