60:00
0/30 Attempted
Your Progress
Attempted 0
Correct 0
Incorrect 0
Skipped 0
Score 0
Marks 0

0 — Test 590

Page 1 of 3

Review Skipped Questions

0
Question 1
A loop keeps reading marks until the user enters -1. What kind of loop is this?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 2
What is a loop invariant?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 3
In this pseudocode, what is the final value of sum? sum = 0 FOR i = 1 TO 10 STEP 3 sum = sum + i
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 4
What is the final value of i? int i = 1; while (i < 100) i *= 2;
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 5
How many times does the body of for (i = 1; i <= 100; i *= 2) execute?
FPSC- Programmer (BS-17) - PMD High Yield - 2026
Question 6
What is the final value of x? x = 0 for i in range(5): for j in range(i): x += 1
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 7
With n = 1234, what is the final value of s? s = 0 while n > 0: s += n % 10 n //= 10
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 8
The digit-reversal routine r = r*10 + n%10; n /= 10; (looping while n > 0) is run with n = 120. What is r?
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 9
What is the bug in this code, given an array of size n? for (i = 0; i <= n; i++) sum += a[i];
FPSC- Programmer (BS-17) - Pakistan Meteorological Department (PMD) Model Papers - 2026
Question 10
A 100 m straight fence needs a post every 10 m, including both ends. How many posts are needed?
FPSC- Programmer (BS-17) - PMD High Yield - 2026