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


Output

 

Subscribe to this Blog via Email :