  Get free ebooK with 50 must do coding Question for Product Based Companies solved
Fill the details & get ebook over email  Thank You!
We have sent the Ebook on 50 Must Do Coding Questions for Product Based Companies Solved over your email. All the best!

# Capgemini Pseudocode Questions | Set 1

Last Updated on October 3, 2022 by Gokul Kannan In this article, we will be discussing the Capgemini Pseudocode Questions. If you would like to ace the Capgemini Pseudocode Questions section easily, then you are at the right place!
Pseudo Code Test Capgemini is a newly introduced Round in Capgemini Placement Test.

### What is Pseudocode? Why are Pseudo Codes important for Capgemini?

Pseudo code is a term that is often used in programming and algorithm-based fields. It is a methodology that allows the programmer to represent the implementation of an algorithm. Simply, we can say that it’s the cooked-up representation of an algorithm. Often, algorithms are represented with the help of pseudo codes as they can be interpreted by programmers no matter what their programming background or knowledge is. Pseudocode, as the name suggests, is a false code or a representation of code that can be understood by even a layman with some school-level programming knowledge.
It’s simply an implementation of an algorithm in the form of annotations and informative text written in plain English. It has no syntax like any of the programming languages and thus can’t be compiled or interpreted by the computer.

• Improves the readability of any approach. It’s one of the best approaches to starting the implementation of an algorithm.
• Acts as a bridge between the program and the algorithm or flowchart. Also works as rough documentation, so the program of one developer can be understood easily when pseudocode is written out. In industries, the approach of documentation is essential. And that’s where a pseudo-code proves vital.
• The main goal of a pseudo-code is to explain what exactly each line of a program should do, hence making the code construction phase easier for the programmer.

This article helps you to understand what type of pseudocode questions will be asked by Capgemini previously, we have gathered some similar questions to provide the latest and actual questions and syllabus for Capgemini Pseudo Code 2023.

### Capgemini Pseudocode Questions

1. What would be the output of the following pseudocode?

``````Integer a
String str1
Set str1 = “goose”
a = stringLength(str1)
Print (a^1)``````
• 0
• 4
• 5
• 3

2. What would be the output of the following pseudocode?

``````Integer a, b, c
Set a = 8, b = 51, c = 2
c = (a^c)^a
b = b mod 4
Print a + b + c``````
• 13
• 17
• 26
• 16

3. Consider an array A = {1, 2, 4, 5, 6, 11, 12} and a key which is equal to 10. How many comparisons would be done to find the key element in the array using the binary search?

• 5
• 1
• 3
• 2

4. What is the output of the following code?

``````Set Integer Emp_no=101
﻿Set Integer salary=0
While (Emp_no=501)
salary=salary+100
display salary
end While﻿``````
• Code executes successfully and the value of salary is displayed once.
• Code executes successfully and nothing is displayed.
• Code executes successfully and the value of salary is displayed an infinite number of times.
• Compile time error.

Answer: Code executes successfully and the value of salary is displayed an infinite number of times.

5. What will be the output of the following pseudocode?

``````Integer a, p
Set a = 5
a = a + 1
a = a * 2
a = a / 2
p = a / 5 + 6
print p``````
• 7
• 0
• 1
• 2

6. What will be the output of the following pseudocode?

``````Integer a, b, c
Set b = 40, a = 20, c = 20
a = a + c
c = c + a
a = a + c
c = c + a
Print a + b + c``````
• 40
• 100
• 300
• None of the above

7. What will be the output of the following pseudocode?

``````Integer a, b
Set a = 1, b = 1
a = (a ^ 1) & (1) + (b ^ 1) & (1)
Print a + b``````
• 0
• 1
• 2
• 3

8. What is the output of the following code?

``````Set Integer res=0
do
--res
display res
res++
while(res>=0)
end do-while``````
• Code executes successfully and the value of salary is displayed once.
• Code executes successfully and nothing is displayed.
• Code executes successfully and the value of salary is displayed an infinite number of times.
• Compile time error.

Answer: Code executes successfully and nothing is displayed.

9. What will happen when the following program is executed?

``````Set Integer res=0
do
--res
display res
res++
while(res>=0)
end do-while``````
• Code will run an infinite number of times.
• The program will not enter the loop.
• Code will execute and the value of res will be displayed twice.
• Code will execute and the value of res will be displayed once.

Answer: Code will run an infinite number of times.

10. What will be the output of the following pseudocode?

``````Integer a, b
Set a = 15, b = 7
a = a mod (a - 3)
b = b mod (b – 3)
a = a mod 1
b = b mod 1
Print a + b

- 0
- 2
- 15
- 7``````

11. What will be the output of the following code?

``````#include<stdio.h>
int main ()
{
char c,a,b;
c='f';
a='s';
b='x';
int sum= c+a+b;
printf ("%d", sum);
}``````
• 324
• 315
• 320
• 337

12. What will be the output of the following pseudocode?

``````Set Character c='7'
switch(c)
case '1':
display "One"
case '7':
display "Seven"
case '2':
display "Two"
default:
display "Hello"
break
end-switch``````
• SevenTwoHello
• OneHello
• SevenTwo
• Seven

13. What will be the output of the following pseudocode?

``````Integer a, p
Set a = 5
a = a + 1
a = a * 2
a = a / 2
p = a / 5 + 6
print p
- 0
- 1
- 2
- 7``````

14. What will be the output of the following pseudocode?

``````Integer a, b
Set a = 1, b = 1
a = (a ^ 1) & (1) + (b ^ 1) & (1)
Print a + b``````
• 0
• 1
• 2
• None of the above.

15. Find the output of the following pseudo-code:

``````Integer value, n
Set value = 1, n = 45
while(value less than equal to n)
value = value << 1
end loop
Print value``````
• 64
• 32
• 45
• None of the above

### Capgemini Pseudocode Questions FAQs

1. How many Questions are there in Capgemini Pseudocode MCQs?
There are 30 questions that need to be solved within 30 mins.

2. What is the level of difficulty for Capgemini pseudocode test questions?
Capgemini pseudo code test questions are of moderate difficulty but you need to score at least 85%ile in this section to get to the next round.

3. What is the syllabus for Capgemini pseudocode round questions and Capgemini pseudocode questions and answers?
There is no such Syllabus for Capgemini pseudocode questions and answers but from what we have observed it has basic C input-output questions and a basic C Syllabus that was there first and we have given chapter-wise questions above please check them Capgemini Pseudocode Round Questions.

4. How do you prepare pseudocode?
Pseudocodes best practice:

1. Limit pseudocode statements to one per line.
2. Use initial capitalization for all keywords.
3. Don’t write source code; write your thoughts on what the program should do.
4. List all steps; a missed step here could result in missed steps in your program.

This article tried to discuss the Capgemini Pseudocode Questions. I hope this blog helps you understand and solve the problem. To practice more problems you can check out MYCODE | Competitive Programming at Prepbytes.