Friday, 16 November 2012

Enter Marks and Get Grade.


#include <iostream>
using namespace std;
int main()
{
int marks;
char grade;
cout << "Enter your test Score: ";
cin >> marks;
if (marks > 80 && marks < 100)
grade='A';
else if (marks > 70 && marks < 80)
grade='B';
else if (marks > 60 && marks < 70)
grade='C';
else
grade='F';
cout << "Your Grade is: " <<grade<<endl;
return 0;
}

No comments:

Post a Comment