Write a program that will accept a mark and assign letter grade according to
the following table.
Grade Mark
A > = 90
B > = 80 but < 90
C > = 70 but < 80
D > = 60 but < 70
F < 60
PROGRAM:
#include <iostream.h>
#include <conio.h>
void main() {
clrscr();
int mark, grade;
cout<<"Enter your mark: ";
cin>>mark;
if(mark>=90)
cout<<"\nYour grade is A";
else if(mark>=80 && mark<90)
cout<<"\nyour grade is B";
else if(mark>=70 && mark<80)
cout<<"\nyour grade is C";
else if(mark>=60 && mark<70)
cout<<"\nyour grade is D";
else
cout<<"\nyour grade is F";
getch();
}//end of the program
No comments:
Post a Comment