Skip to content

Commit c6e0cfd

Browse files
authored
Create Ques14.cpp
1 parent e5005a6 commit c6e0cfd

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Ques14.cpp

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
6+
int marks;
7+
8+
cout << "Enter marks obtained: ";
9+
cin >> marks;
10+
11+
if (marks < 0 || marks > 100)
12+
{
13+
cout << "Error: Marks should be between 0 and 100." << endl;
14+
}
15+
else if (marks >= 90)
16+
{
17+
cout << "Grade: A+" << endl;
18+
}
19+
else if (marks >= 70)
20+
{
21+
cout << "Grade: A" << endl;
22+
}
23+
else if (marks >= 50)
24+
{
25+
cout << "Grade: B" << endl;
26+
}
27+
else
28+
{
29+
cout << "Grade: F" << endl;
30+
}
31+
32+
return 0;
33+
}

0 commit comments

Comments
 (0)