Skip to content

Several choices

Watch it run · 1 of 3

Turning marks into a grade

1#include <iostream>
2using namespace std;
3
4int main() {
5 int marks;
6 cin >> marks;
7 if (marks >= 90) {
8 cout << "A" << endl;
9 } else if (marks >= 75) {
10 cout << "B" << endl;
11 } else if (marks >= 60) {
12 cout << "C" << endl;
13 } else {
14 cout << "F" << endl;
15 }
16 return 0;
17}

Memory

int marks

72

Typed input

72

Output

(nothing yet)

line 6Read 72.

step 1 of 5