-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestions_medium.cpp
More file actions
33 lines (32 loc) · 1.13 KB
/
questions_medium.cpp
File metadata and controls
33 lines (32 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "questions.h"
vector<Question> loadMediumQuestions()
{
return
{
{ //01
"What is the output of the following code snippet?\n int x = 5;\n cout << ++x << endl;",
{"5", "6", "7", "Error"},
'B'
},
{ //02
"What is the output of the following code snippet?\n bool a = true;\n bool b = false;\n cout << (a && b) << endl;",
{"0", "1", "true", "false"},
'A'
},
{ //03
"What is the output of the following code snippet?\n int arr[] = {1, 2, 3};\n cout << arr[1] << endl;",
{"1", "2", "3", "Error"},
'B'
},
{ //04
"What is the output of the following code snippet?\n for(int i = 0; i < 3; i++) {\n cout << i << \" \";\n }",
{"0 1 2 ", "1 2 3 ", "0 1 2 3 ", "Error"},
'A'
},
{ //05
"What is the output of the following code snippet?\n int x = 10;\n if(x > 5) {\n cout << \"Greater\" << endl;\n } else {\n cout << \"Smaller\" << endl;\n }",
{"Greater", "Smaller", "10", "Error"},
'A'
}
};
}