FPSC- Programmer (BS-17) - PMD High Yield - 2026 — Test 1
Page 1 of 3
Question 1
How does the standard CPython implementation run a .py file?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 2
What is the correct order of stages when building a C++ program?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 3
A program declares a function prototype and calls it, but the function body is never defined anywhere. When is the 'undefined reference' error reported?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 4
A program compiles and runs without crashing, but it reports the average of 10 numbers incorrectly because it divides by 9. What kind of error is this?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 5
What is the output of this Python code?
x = 10
def f():
print(x)
x = 5
f()
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 6
What does this Python code print?
fs = [lambda: i for i in range(3)]
print([f() for f in fs])
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 7
What does this Python code print?
def f(x, L=[]):
L.append(x)
return L
f(1)
print(f(2))
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 8
In C++, what is the result of int a = 5; int b = a++ + ++a;?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 9
In C, what is the value of the expression 5 / 2 * 2.0?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 10
In Python 3, what is -7 // 2?
FPSC- Programmer (BS-17) - PMD High Yield - 2026