0 — Test 583
Page 1 of 3
Question 1
What does this C++ code print?
switch(2){
case 1: cout<<"A";
case 2: cout<<"B";
case 3: cout<<"C"; break;
default: cout<<"D";
}
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 2
What does this Python code print?
for i in range(3):
if i == 5:
break
else:
print("done")
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 3
What does this C++ code print?
int i = 10;
do { cout << i; i++; } while (i < 5);
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 4
What does this C++ code print?
for (int i = 0; i < 5; i++);
{ cout << "x"; }
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 5
In the C code if (a) if (b) s1; else s2;, which if does the else belong to?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 6
What happens when this C code runs?
int i = 0;
while (i < 5) {
if (i == 2) continue;
i++;
}
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 7
How many values does Python's range(10, 0, -3) produce?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 8
What does this Python code print?
L = [1, 2, 3, 4]
for x in L:
L.remove(x)
print(L)
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 9
In C++ nested loops, what does break do?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 10
What does this Python code print?
for i in range(3):
pass
print(i)
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026