Last Updated on October 3, 2022 by Gokul Kannan
In this article, we will be discussing the Capgemini Pseudocode Questions and Answers. Capgemini doesn’t care if you’re a non-CS/IT student, they will anyways ask you about Data Structures. According to them, if you’re applying to an IT company, you must know coding.
Topics | No. of questions (approx) |
---|---|
Pseudo Code on C | 16 Questions |
Pseudo Code on C++ | 4 |
Pseudo Code on DSA | 10 Questions |
Capgemini Pseudocode Questions
1. Find the output of the following code.
main() {
int a = 10;
if ((fork ( ) == 0))
a++;
printf ("%dn", a );
}
- 10 and 11
- 10
- 11
- 11 and 11
Answer: 10
2. Find the output of the following code.
#include <stdio.h>
main( ) {
int i;
for ( i=0; i < 5; i++ ) {
int i = 10;
printf ( " % d ", i );
i++;
}
return 0;
}
- 10 11 12 13 14
- 10 10 10 10 10
- 0 1 2 3 4
- Compilation error
Answer: 10 10 10 10 10
3. Guess the output of the pseudo-code.
struct
{
int si;
double d;
float cp;
} s;
void
main ()
{
printf ("%d, %d, %d", sizeof (s.si), sizeof (s.d), sizeof (s.cp));
}
- 6,10,8
- 4,8,4
- 2,8,8
- 2,4,4
Answer: 4,8,4
4. Find the output of the following code.
int main ()
{
int a, b;
a = b = 4;
b = a++;
printf ("%d %d %d %d", a++, --b, ++a, b--);
}
- 5 3 7 3
- 5 4 5 3
- 6 2 6 4
- Syntax Error
Answer: 6 2 6 4
5. Guess the output of the following code.
int main ()
{
int a[4] = { 25, 16 };
printf ("%d %d", a[0] & a[1], a[1] | a[2]);
}
- Syntax error because of invalid operator symbol
- 25 16
- 16 16
- Syntax error because of invalid array initialization
Answer: 16 16
6. Find the output of the following pseudocode.
int main ()
{
static int num = 8;
printf ("%d", num = num - 2);
if (num != 0)
main ();
}
- 8 6 4 2
- Infinite output
- Invalid because the main function can’t call itself.
- 6 4 2 0
Answer: 6 4 2 0
7. Find the output of the following code.
int main ()
{
int check = 2;
switch (check)
{
case 1:
printf ("D.W.Steyn");
case 2:
printf (" M.G.Johnson");
case 3:
printf (" Mohammad Asif");
default:
printf (" M.Muralidaran");
}
return 0;
}
- D.W.Steyn
- D.W.Steyn M.G.Johnson
- M.G.Johnson
- M.G.Johnson Mohammad Asif M.Muralidaran
Answer: M.G.Johnson Mohammad Asif M.Muralidaran
8. Guess the output of the following code.
int main() {
int m = -10, n = 20;
n = (m < 0) ? 0 : 1;
printf("%d %d", m, n);
}
- -10 0
- 10 20
- 20 -10
- 0 1
Answer: -10 0
9. Predict the output of the given pseudo code.
int main() {
char c = 'f';
switch (c) {
default: printf("unknown colour ");
case 'r': case 'R': printf("Red ");
case 'g': case 'G': printf("Green "); break;
case 'b': case 'B': printf("Blue");
}
}
- Red Green Blue
- Error
- Green unknown colour Red
- unknown colour Red Green
Answer: unknown colour Red Green
10. Guess the output of the given code below.
int main() {
int a = 100, b = 74;
if (a++ > 100 && b++ > 200)
printf("High values with a = %d b = %dn", a, b);
if (a++ < 100 || b++ < 200)
printf("Low values with a = %d b = %dn", a, b);
}
- Low values with a = 100 b = 74
- Low values with a = 101 b = 73
- Low values with a = 102 b = 75
- Low values with a = 104 b = 75
Answer: Low values with a = 102 b = 75
11. Find the output of the following code.
int main() {
char p[] = "%dn";
p[1] = 'c';
printf(p, 65);
int k=40, *a;
a = &k;
(*a)++; k++;
printf("n k=%d",k);
}
- c k=40
- b k=44
- A k=42
- a k=40
Answer: A k=42
12. Guess the output of the given code.
main() {
int i = 2, *j;
j = &i;
printf("%d", i**j*i+*j);
}
- Syntax error due to Invalid expression in printf
- Print junk value
- 16
- 10
Answer: 10
13. Guess the output of the following pseudo-code.
int main() {
int x,y,z;
x = '1'-'0'; /* line-1 */
y = 'a'-'b'; /* line-2 */
z = x + y;
printf("%d",z);
}
- 0
- Error because of incorrect line-1 only.
- Error because of incorrect line-1 and line-2.
- Error because of incorrect line-2 only.
Answer: 0
14. Find the output of the given code.
void main ( )
{
char *P = "ayqm" ;
char c;
c = ++*p ;
printf ("%c", c);
}
- a
- 0x56FA
- m
- y
Answer: a
15. Guess the output of the given pseudo code.
void main()
{
int a = 1, b=2, c=3;
char d = 0;
if(a,b,c,d)
{
printf("EXAM");
}
}
- No Output and No Error
- EXAM
- Run time error
- Compile time error
Answer: No Output and No Error
Capgemini Pseudocode Questions FAQs
1. Is pseudocode easy to learn?
Pseudocode is a simple way to represent an algorithm or program. It is written easily in a word processing application and easily modified. Pseudocode is easy to understand and can be written by anyone. Pseudocode can be used with various structured programming languages.
2. Pseudocode is mainly written in which programming language?
Pesudo-Codes are the language-free representation of the algorithm that explains the more coded format of the algorithm but not the complete representation of the code in any specific language.
3. How many Questions are there in Capgemini Pseudocode MCQs?
There are 30 questions that need to be solved within 30 mins.
4. 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.
We tried to discuss Capgemini Pseudocode Questions in this article. We hope this article gives you a better understanding of basics in Data Structures and Algorithms. Prepbytes also provides a good collection of Foundation Courses that can help you enhance your coding skills. Want to make sure you ace the interview in one go? Join our Placement Program that will help you get prepared and land your dream job at MNCs. Mentors of Prepbytes are highly experienced and can provide you with basic, in-depth subject knowledge for better understanding.