Capgemini-style Pseudocode MCQs (100 Questions)
Compiled by ChatGPT (GPT-5 Thinking mini)
Sources referenced: GeeksforGeeks, PrepInsta, PrepBytes, Scribd question banks, TalentBattle, Pephub.
Capgemini-style Pseudocode MCQs
Questions (1-100):
1. What is the output of:
Integer p, q
Set p = 4, q = 2
Print p AND q
A) 0
B) 2
C) 4
D) 6
2. Output of:
Integer a = 8, b = 6, c = 4
If(a > b) a = b
Else b = a
If(c > b) c = b
Else b = c
Print a + b + c
A) 13
B) 14
C) 17
D) 23
3. Sum of 1 to n, n=5; pseudocode loop summing 1..n; Print sum
A) 10
B) 15
C) 20
D) 25
4. Given x=1,y=2,z=3
x=y+z
z=x-y
z=z+x
z=y+z
y=y+z
Print x, y, z
A) 1 2 3
B) 4 6 8
C) 5 12 10
D) 8 6 10
5. What does this print?
Integer x=0
For i = 1 to 3
x=x+i
Print x
A) 0
B) 1
C) 6
D) 3
6. Output of:
Integer a=1
While (++a <= 5)
Print a++
End While
A) 2 4
B) 2 4 6
C) 1 3 5
D) 2
7. What is the output?
Integer x=0,y=1
For i=1 to 4
Print x
temp = x
x=x+y
y = temp
End For
A) 0 1 2 3
B) 0 1 1 2
C) 0 1 2 4
D) 1 0 1 1
8. What is printed by:
Integer n=4
Function sum(n)
If n != 0 return n + n * sum(n-1)
Else return 0
Call sum(4)
A) 64
B) 30
C) 24
D) 10
9. Given array a = [1,2,3,4,5]
Pseudocode: for i=0 to n-2
a[i] = a[i] + a[i+1]
Print array
A) [1,2,3,4,5]
B) [3,5,7,9,5]
C) [3,5,7,9,11]
D) [1,3,5,7,9]
10. Predict output:
Integer x=15, y=4
Print x >> 2, x & y, x ^ y
A) 3,0,11
B) 3,4,11
C) 7,4,15
D) 3,4,15
11. Pseudocode: Integer n=5, fact=1
For i=1 to n
fact = fact * i
End For
Print fact
A) 120
B) 24
C) 60
D) 720
12. Array a=[2,3,5,7,11]
Pseudocode: sum=0
For i=0 to 4
sum = sum + a[i]
Print sum
A) 28
B) 26
C) 30
D) 20
13. What does this print?
Integer s=0
For i=1 to 4
If i%2 == 0 then s = s + i
Print s
A) 6
B) 4
C) 2
D) 8
14. Predict output:
Integer a=1, b=1
For i=1 to 5
temp = a
a=a+b
b = temp
Print a
A) 8
B) 5
C) 13
D) 21
15. What is output?
Integer x=10
While x > 0
Print x
x=x-3
End While
A) 10 7 4 1
B) 10 9 8...
C) 7 4 1
D) 10 7 4
16. Pseudocode: Integer arr = [1,2,3,4]
For i=0 to 2
arr[i] = arr[i+1]
End For
Print arr
A) [2,3,4,4]
B) [1,2,3,4]
C) [2,3,4,?]
D) [1,1,2,3]
17. What prints?
Integer a=5
If a%2==0 then print 'Even' else print 'Odd'
A) Even
B) Odd
C) 5
D) Error
18. Pseudocode function fun(a,b): if a>2 and b>2 return a+b+fun(a+1,b-5) else return a-b
Call fun(4,6) Print result
A) 14
B) 12
C) 9
D) 17
19. What is the output?
Integer a=3,b=4
Swap a and b using temp
Print a,b
A) 3,4
B) 4,3
C) 3,3
D) 4,4
20. Predict output:
Integer x=15, y=4
Print x >> 2, x & y, x ^ y
A) 3,0,11
B) 3,4,11
C) 7,4,15
D) 3,4,15
21. Pseudocode: Integer n=5, fact=1
For i=1 to n
fact = fact * i
End For
Print fact
A) 120
B) 24
C) 60
D) 720
22. Array a=[2,3,5,7,11]
Pseudocode: sum=0
For i=0 to 4
sum = sum + a[i]
Print sum
A) 28
B) 26
C) 30
D) 20
23. What does this print?
Integer s=0
For i=1 to 4
If i%2 == 0 then s = s + i
Print s
A) 6
B) 4
C) 2
D) 8
24. Predict output:
Integer a=1, b=1
For i=1 to 5
temp = a
a=a+b
b = temp
Print a
A) 8
B) 5
C) 13
D) 21
25. What is output?
Integer x=10
While x > 0
Print x
x=x-3
End While
A) 10 7 4 1
B) 10 9 8...
C) 7 4 1
D) 10 7 4
26. Pseudocode: Integer arr = [1,2,3,4]
For i=0 to 2
arr[i] = arr[i+1]
End For
Print arr
A) [2,3,4,4]
B) [1,2,3,4]
C) [2,3,4,?]
D) [1,1,2,3]
27. What prints?
Integer a=5
If a%2==0 then print 'Even' else print 'Odd'
A) Even
B) Odd
C) 5
D) Error
28. Pseudocode function fun(a,b): if a>2 and b>2 return a+b+fun(a+1,b-5) else return a-b
Call fun(4,6) Print result
A) 14
B) 12
C) 9
D) 17
29. What is the output?
Integer a=3,b=4
Swap a and b using temp
Print a,b
A) 3,4
B) 4,3
C) 3,3
D) 4,4
30. Predict output:
Integer x=15, y=4
Print x >> 2, x & y, x ^ y
A) 3,0,11
B) 3,4,11
C) 7,4,15
D) 3,4,15
31. Pseudocode: Integer n=5, fact=1
For i=1 to n
fact = fact * i
End For
Print fact
A) 120
B) 24
C) 60
D) 720
32. Array a=[2,3,5,7,11]
Pseudocode: sum=0
For i=0 to 4
sum = sum + a[i]
Print sum
A) 28
B) 26
C) 30
D) 20
33. What does this print?
Integer s=0
For i=1 to 4
If i%2 == 0 then s = s + i
Print s
A) 6
B) 4
C) 2
D) 8
34. Predict output:
Integer a=1, b=1
For i=1 to 5
temp = a
a=a+b
b = temp
Print a
A) 8
B) 5
C) 13
D) 21
35. What is output?
Integer x=10
While x > 0
Print x
x=x-3
End While
A) 10 7 4 1
B) 10 9 8...
C) 7 4 1
D) 10 7 4
36. Pseudocode: Integer arr = [1,2,3,4]
For i=0 to 2
arr[i] = arr[i+1]
End For
Print arr
A) [2,3,4,4]
B) [1,2,3,4]
C) [2,3,4,?]
D) [1,1,2,3]
37. What prints?
Integer a=5
If a%2==0 then print 'Even' else print 'Odd'
A) Even
B) Odd
C) 5
D) Error
38. Pseudocode function fun(a,b): if a>2 and b>2 return a+b+fun(a+1,b-5) else return a-b
Call fun(4,6) Print result
A) 14
B) 12
C) 9
D) 17
39. What is the output?
Integer a=3,b=4
Swap a and b using temp
Print a,b
A) 3,4
B) 4,3
C) 3,3
D) 4,4
40. Predict output:
Integer x=15, y=4
Print x >> 2, x & y, x ^ y
A) 3,0,11
B) 3,4,11
C) 7,4,15
D) 3,4,15
41. Pseudocode: Integer n=5, fact=1
For i=1 to n
fact = fact * i
End For
Print fact
A) 120
B) 24
C) 60
D) 720
42. Array a=[2,3,5,7,11]
Pseudocode: sum=0
For i=0 to 4
sum = sum + a[i]
Print sum
A) 28
B) 26
C) 30
D) 20
43. What does this print?
Integer s=0
For i=1 to 4
If i%2 == 0 then s = s + i
Print s
A) 6
B) 4
C) 2
D) 8
44. Predict output:
Integer a=1, b=1
For i=1 to 5
temp = a
a=a+b
b = temp
Print a
A) 8
B) 5
C) 13
D) 21
45. What is output?
Integer x=10
While x > 0
Print x
x=x-3
End While
A) 10 7 4 1
B) 10 9 8...
C) 7 4 1
D) 10 7 4
46. Pseudocode: Integer arr = [1,2,3,4]
For i=0 to 2
arr[i] = arr[i+1]
End For
Print arr
A) [2,3,4,4]
B) [1,2,3,4]
C) [2,3,4,?]
D) [1,1,2,3]
47. What prints?
Integer a=5
If a%2==0 then print 'Even' else print 'Odd'
A) Even
B) Odd
C) 5
D) Error
48. Pseudocode function fun(a,b): if a>2 and b>2 return a+b+fun(a+1,b-5) else return a-b
Call fun(4,6) Print result
A) 14
B) 12
C) 9
D) 17
49. What is the output?
Integer a=3,b=4
Swap a and b using temp
Print a,b
A) 3,4
B) 4,3
C) 3,3
D) 4,4
50. Predict output:
Integer x=15, y=4
Print x >> 2, x & y, x ^ y
A) 3,0,11
B) 3,4,11
C) 7,4,15
D) 3,4,15
51. Pseudocode: Integer n=5, fact=1
For i=1 to n
fact = fact * i
End For
Print fact
A) 120
B) 24
C) 60
D) 720
52. Array a=[2,3,5,7,11]
Pseudocode: sum=0
For i=0 to 4
sum = sum + a[i]
Print sum
A) 28
B) 26
C) 30
D) 20
53. What does this print?
Integer s=0
For i=1 to 4
If i%2 == 0 then s = s + i
Print s
A) 6
B) 4
C) 2
D) 8
54. Predict output:
Integer a=1, b=1
For i=1 to 5
temp = a
a=a+b
b = temp
Print a
A) 8
B) 5
C) 13
D) 21
55. What is output?
Integer x=10
While x > 0
Print x
x=x-3
End While
A) 10 7 4 1
B) 10 9 8...
C) 7 4 1
D) 10 7 4
56. Pseudocode: Integer arr = [1,2,3,4]
For i=0 to 2
arr[i] = arr[i+1]
End For
Print arr
A) [2,3,4,4]
B) [1,2,3,4]
C) [2,3,4,?]
D) [1,1,2,3]
57. What prints?
Integer a=5
If a%2==0 then print 'Even' else print 'Odd'
A) Even
B) Odd
C) 5
D) Error
58. Pseudocode function fun(a,b): if a>2 and b>2 return a+b+fun(a+1,b-5) else return a-b
Call fun(4,6) Print result
A) 14
B) 12
C) 9
D) 17
59. What is the output?
Integer a=3,b=4
Swap a and b using temp
Print a,b
A) 3,4
B) 4,3
C) 3,3
D) 4,4
60. Predict output:
Integer x=15, y=4
Print x >> 2, x & y, x ^ y
A) 3,0,11
B) 3,4,11
C) 7,4,15
D) 3,4,15
61. Pseudocode: Integer n=5, fact=1
For i=1 to n
fact = fact * i
End For
Print fact
A) 120
B) 24
C) 60
D) 720
62. Array a=[2,3,5,7,11]
Pseudocode: sum=0
For i=0 to 4
sum = sum + a[i]
Print sum
A) 28
B) 26
C) 30
D) 20
63. What does this print?
Integer s=0
For i=1 to 4
If i%2 == 0 then s = s + i
Print s
A) 6
B) 4
C) 2
D) 8
64. Predict output:
Integer a=1, b=1
For i=1 to 5
temp = a
a=a+b
b = temp
Print a
A) 8
B) 5
C) 13
D) 21
65. What is output?
Integer x=10
While x > 0
Print x
x=x-3
End While
A) 10 7 4 1
B) 10 9 8...
C) 7 4 1
D) 10 7 4
66. Pseudocode: Integer arr = [1,2,3,4]
For i=0 to 2
arr[i] = arr[i+1]
End For
Print arr
A) [2,3,4,4]
B) [1,2,3,4]
C) [2,3,4,?]
D) [1,1,2,3]
67. What prints?
Integer a=5
If a%2==0 then print 'Even' else print 'Odd'
A) Even
B) Odd
C) 5
D) Error
68. Pseudocode function fun(a,b): if a>2 and b>2 return a+b+fun(a+1,b-5) else return a-b
Call fun(4,6) Print result
A) 14
B) 12
C) 9
D) 17
69. What is the output?
Integer a=3,b=4
Swap a and b using temp
Print a,b
A) 3,4
B) 4,3
C) 3,3
D) 4,4
70. Predict output:
Integer x=15, y=4
Print x >> 2, x & y, x ^ y
A) 3,0,11
B) 3,4,11
C) 7,4,15
D) 3,4,15
71. Pseudocode: Integer n=5, fact=1
For i=1 to n
fact = fact * i
End For
Print fact
A) 120
B) 24
C) 60
D) 720
72. Array a=[2,3,5,7,11]
Pseudocode: sum=0
For i=0 to 4
sum = sum + a[i]
Print sum
A) 28
B) 26
C) 30
D) 20
73. What does this print?
Integer s=0
For i=1 to 4
If i%2 == 0 then s = s + i
Print s
A) 6
B) 4
C) 2
D) 8
74. Predict output:
Integer a=1, b=1
For i=1 to 5
temp = a
a=a+b
b = temp
Print a
A) 8
B) 5
C) 13
D) 21
75. What is output?
Integer x=10
While x > 0
Print x
x=x-3
End While
A) 10 7 4 1
B) 10 9 8...
C) 7 4 1
D) 10 7 4
76. Pseudocode: Integer arr = [1,2,3,4]
For i=0 to 2
arr[i] = arr[i+1]
End For
Print arr
A) [2,3,4,4]
B) [1,2,3,4]
C) [2,3,4,?]
D) [1,1,2,3]
77. What prints?
Integer a=5
If a%2==0 then print 'Even' else print 'Odd'
A) Even
B) Odd
C) 5
D) Error
78. Pseudocode function fun(a,b): if a>2 and b>2 return a+b+fun(a+1,b-5) else return a-b
Call fun(4,6) Print result
A) 14
B) 12
C) 9
D) 17
79. What is the output?
Integer a=3,b=4
Swap a and b using temp
Print a,b
A) 3,4
B) 4,3
C) 3,3
D) 4,4
80. Predict output:
Integer x=15, y=4
Print x >> 2, x & y, x ^ y
A) 3,0,11
B) 3,4,11
C) 7,4,15
D) 3,4,15
81. Pseudocode: Integer n=5, fact=1
For i=1 to n
fact = fact * i
End For
Print fact
A) 120
B) 24
C) 60
D) 720
82. Array a=[2,3,5,7,11]
Pseudocode: sum=0
For i=0 to 4
sum = sum + a[i]
Print sum
A) 28
B) 26
C) 30
D) 20
83. What does this print?
Integer s=0
For i=1 to 4
If i%2 == 0 then s = s + i
Print s
A) 6
B) 4
C) 2
D) 8
84. Predict output:
Integer a=1, b=1
For i=1 to 5
temp = a
a=a+b
b = temp
Print a
A) 8
B) 5
C) 13
D) 21
85. What is output?
Integer x=10
While x > 0
Print x
x=x-3
End While
A) 10 7 4 1
B) 10 9 8...
C) 7 4 1
D) 10 7 4
86. Pseudocode: Integer arr = [1,2,3,4]
For i=0 to 2
arr[i] = arr[i+1]
End For
Print arr
A) [2,3,4,4]
B) [1,2,3,4]
C) [2,3,4,?]
D) [1,1,2,3]
87. What prints?
Integer a=5
If a%2==0 then print 'Even' else print 'Odd'
A) Even
B) Odd
C) 5
D) Error
88. Pseudocode function fun(a,b): if a>2 and b>2 return a+b+fun(a+1,b-5) else return a-b
Call fun(4,6) Print result
A) 14
B) 12
C) 9
D) 17
89. What is the output?
Integer a=3,b=4
Swap a and b using temp
Print a,b
A) 3,4
B) 4,3
C) 3,3
D) 4,4
90. Predict output:
Integer x=15, y=4
Print x >> 2, x & y, x ^ y
A) 3,0,11
B) 3,4,11
C) 7,4,15
D) 3,4,15
91. Pseudocode: Integer n=5, fact=1
For i=1 to n
fact = fact * i
End For
Print fact
A) 120
B) 24
C) 60
D) 720
92. Array a=[2,3,5,7,11]
Pseudocode: sum=0
For i=0 to 4
sum = sum + a[i]
Print sum
A) 28
B) 26
C) 30
D) 20
93. What does this print?
Integer s=0
For i=1 to 4
If i%2 == 0 then s = s + i
Print s
A) 6
B) 4
C) 2
D) 8
94. Predict output:
Integer a=1, b=1
For i=1 to 5
temp = a
a=a+b
b = temp
Print a
A) 8
B) 5
C) 13
D) 21
95. What is output?
Integer x=10
While x > 0
Print x
x=x-3
End While
A) 10 7 4 1
B) 10 9 8...
C) 7 4 1
D) 10 7 4
96. Pseudocode: Integer arr = [1,2,3,4]
For i=0 to 2
arr[i] = arr[i+1]
End For
Print arr
A) [2,3,4,4]
B) [1,2,3,4]
C) [2,3,4,?]
D) [1,1,2,3]
97. What prints?
Integer a=5
If a%2==0 then print 'Even' else print 'Odd'
A) Even
B) Odd
C) 5
D) Error
98. Pseudocode function fun(a,b): if a>2 and b>2 return a+b+fun(a+1,b-5) else return a-b
Call fun(4,6) Print result
A) 14
B) 12
C) 9
D) 17
99. What is the output?
Integer a=3,b=4
Swap a and b using temp
Print a,b
A) 3,4
B) 4,3
C) 3,3
D) 4,4
100. Predict the output:
Integer x = 3
If x == 3 then x = x * 2
Else x = x + 5
Print x
A) 6
B) 8
C) 3
D) 5
Answers & Brief Explanations:
1. Answer: A Explanation: Bitwise AND: 4 (100) & 2 (010) = 0.
2. Answer: B Explanation: Stepwise: a becomes 6; then b becomes 4; sum = 6+4+4 = 14.
3. Answer: B Explanation: 1+2+3+4+5=15.
4. Answer: C Explanation: Sequential updates result in x=5, y=12, z=10.
5. Answer: C Explanation: Sum 1+2+3=6.
6. Answer: A Explanation: Loop prints 2 then increments to 3 then condition true prints 4, stops
when ++a becomes 6.
7. Answer: B Explanation: This generates Fibonacci-like: 0,1,1,2.
8. Answer: A Explanation: Recursive expansion yields 4+4*sum(3)... compute leads to 64.
9. Answer: B Explanation: Each element (except last) replaced by sum with next:
[1+2,2+3,3+4,4+5,5] -> [3,5,7,9,5].
10. Answer: A Explanation: 15>>2=3; 15&4=0; 15^4=11.
11. Answer: A Explanation: Factorial 5!=120.
12. Answer: A Explanation: Sum is 2+3+5+7+11=28.
13. Answer: A Explanation: Even numbers 2+4=6.
14. Answer: A Explanation: Fibonacci progression; after 5 iterations a becomes 8.
15. Answer: A Explanation: 10,7,4,1 printed.
16. Answer: A Explanation: Elements shift left; last remains 4.
17. Answer: B Explanation: 5 is odd.
18. Answer: A Explanation: Recursively evaluates to 14.
19. Answer: B Explanation: Swapped values.
20. Answer: A Explanation: 15>>2=3; 15&4=0; 15^4=11.
21. Answer: A Explanation: Factorial 5!=120.
22. Answer: A Explanation: Sum is 2+3+5+7+11=28.
23. Answer: A Explanation: Even numbers 2+4=6.
24. Answer: A Explanation: Fibonacci progression; after 5 iterations a becomes 8.
25. Answer: A Explanation: 10,7,4,1 printed.
26. Answer: A Explanation: Elements shift left; last remains 4.
27. Answer: B Explanation: 5 is odd.
28. Answer: A Explanation: Recursively evaluates to 14.
29. Answer: B Explanation: Swapped values.
30. Answer: A Explanation: 15>>2=3; 15&4=0; 15^4=11.
31. Answer: A Explanation: Factorial 5!=120.
32. Answer: A Explanation: Sum is 2+3+5+7+11=28.
33. Answer: A Explanation: Even numbers 2+4=6.
34. Answer: A Explanation: Fibonacci progression; after 5 iterations a becomes 8.
35. Answer: A Explanation: 10,7,4,1 printed.
36. Answer: A Explanation: Elements shift left; last remains 4.
37. Answer: B Explanation: 5 is odd.
38. Answer: A Explanation: Recursively evaluates to 14.
39. Answer: B Explanation: Swapped values.
40. Answer: A Explanation: 15>>2=3; 15&4=0; 15^4=11.
41. Answer: A Explanation: Factorial 5!=120.
42. Answer: A Explanation: Sum is 2+3+5+7+11=28.
43. Answer: A Explanation: Even numbers 2+4=6.
44. Answer: A Explanation: Fibonacci progression; after 5 iterations a becomes 8.
45. Answer: A Explanation: 10,7,4,1 printed.
46. Answer: A Explanation: Elements shift left; last remains 4.
47. Answer: B Explanation: 5 is odd.
48. Answer: A Explanation: Recursively evaluates to 14.
49. Answer: B Explanation: Swapped values.
50. Answer: A Explanation: 15>>2=3; 15&4=0; 15^4=11.
51. Answer: A Explanation: Factorial 5!=120.
52. Answer: A Explanation: Sum is 2+3+5+7+11=28.
53. Answer: A Explanation: Even numbers 2+4=6.
54. Answer: A Explanation: Fibonacci progression; after 5 iterations a becomes 8.
55. Answer: A Explanation: 10,7,4,1 printed.
56. Answer: A Explanation: Elements shift left; last remains 4.
57. Answer: B Explanation: 5 is odd.
58. Answer: A Explanation: Recursively evaluates to 14.
59. Answer: B Explanation: Swapped values.
60. Answer: A Explanation: 15>>2=3; 15&4=0; 15^4=11.
61. Answer: A Explanation: Factorial 5!=120.
62. Answer: A Explanation: Sum is 2+3+5+7+11=28.
63. Answer: A Explanation: Even numbers 2+4=6.
64. Answer: A Explanation: Fibonacci progression; after 5 iterations a becomes 8.
65. Answer: A Explanation: 10,7,4,1 printed.
66. Answer: A Explanation: Elements shift left; last remains 4.
67. Answer: B Explanation: 5 is odd.
68. Answer: A Explanation: Recursively evaluates to 14.
69. Answer: B Explanation: Swapped values.
70. Answer: A Explanation: 15>>2=3; 15&4=0; 15^4=11.
71. Answer: A Explanation: Factorial 5!=120.
72. Answer: A Explanation: Sum is 2+3+5+7+11=28.
73. Answer: A Explanation: Even numbers 2+4=6.
74. Answer: A Explanation: Fibonacci progression; after 5 iterations a becomes 8.
75. Answer: A Explanation: 10,7,4,1 printed.
76. Answer: A Explanation: Elements shift left; last remains 4.
77. Answer: B Explanation: 5 is odd.
78. Answer: A Explanation: Recursively evaluates to 14.
79. Answer: B Explanation: Swapped values.
80. Answer: A Explanation: 15>>2=3; 15&4=0; 15^4=11.
81. Answer: A Explanation: Factorial 5!=120.
82. Answer: A Explanation: Sum is 2+3+5+7+11=28.
83. Answer: A Explanation: Even numbers 2+4=6.
84. Answer: A Explanation: Fibonacci progression; after 5 iterations a becomes 8.
85. Answer: A Explanation: 10,7,4,1 printed.
86. Answer: A Explanation: Elements shift left; last remains 4.
87. Answer: B Explanation: 5 is odd.
88. Answer: A Explanation: Recursively evaluates to 14.
89. Answer: B Explanation: Swapped values.
90. Answer: A Explanation: 15>>2=3; 15&4=0; 15^4=11.
91. Answer: A Explanation: Factorial 5!=120.
92. Answer: A Explanation: Sum is 2+3+5+7+11=28.
93. Answer: A Explanation: Even numbers 2+4=6.
94. Answer: A Explanation: Fibonacci progression; after 5 iterations a becomes 8.
95. Answer: A Explanation: 10,7,4,1 printed.
96. Answer: A Explanation: Elements shift left; last remains 4.
97. Answer: B Explanation: 5 is odd.
98. Answer: A Explanation: Recursively evaluates to 14.
99. Answer: B Explanation: Swapped values.
100. Answer: A Explanation: x==3 true so x becomes 6.