0% found this document useful (0 votes)
144 views

Pseudo Code

Uploaded by

Ayan Haque
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views

Pseudo Code

Uploaded by

Ayan Haque
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Capgemini Pseudo Coding Questions

1. How should we present the statement language while writing a pseudo code?
a) Dependent
b) Independent
c) Case Sensitive
d) Capitalized

Ans:- Independent

2. We should capitalize initial keyword while writing the pseudocode___ This is a rule.
a) True
b) False
c) Depends on code
d) Depends on your wish

Ans:- True

3. 3 of the 4 following options is keywords. Which of the following is not a keyword ?


a) Read
b) Write
c) Start
d) If

Ans:- Start

4. Which of the following is used to show hierarchy in a pseudo code .


a) Indentation
b) Curly Braces
c) Round Brackets
d) Semicolon

Ans :- Indentation

5. Which of the following options tells the computer to get a value from an input device
and store it in a memory location?
a) Read
b) Write
c) READ
d) WRITE

Ans:- READ

6. Which of the following options is identified by their addresses, we give them names
(field names / variable names) using words.
a) Memory variables
b) Memory Locations
c) Memory Addresses
d) Data Variables

Ans :- Memory Location

7. With respect to the rules of pseudocode, Which of the following options begins with
lower case letters.
a) Keywords

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
b) Variables
c) Tokens
d) Functions

Ans Variables

8. Exponentiation can also be represented as____


a) *
b) **
c) ***
d) *^

Ans **

9. Which of the following symbols is used for grouping ?


a) ()
b) {}
c) []
d) “ ”

Ans ()

10. ____is used to closed the IF block.


a) ELSE
b) ELSEIF
c) END
d) ENDIF

Ans ENDIF

1. below is a pseudo code


Set x = 1
Set n = 200
while(n>100):
x=x-n
n=n-5
end while
Write x
What is the output of the above pseudocode?
a) -3049
b) -3048
c) -3047
d) -3059

Ans:- -3049

2. Below is a pseudo-code
Set x = 0;
Set y = 1;
Set n = 0
print(8)
print(1)

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
while(n<18-2):
Set z=x+y
Swap x, y with y, z
Write z
Increment of n by 1
In which series is the output
a) Fibonacci series
b) Tribonacci series
c) Triangular
d) Arithmetic series
Ans Fibonacci series
3. What will be the output of the following pseudocode?
Integer x, y, z
Set x=3
Set y=90
while(y is greater than 0);
y=y/3
x=x+6
c=x+y
while(c is greater than 30):
if(c mod 3 is equals to 0):
Write x
else:
Write y
c=c/5
Write c
a. 9,33
b. 9,30
c. 9,36,9
d. 9 33 6
Ans 9 33 6
4. What will be the output of the following pseudocode?
int main()
{
integer num;
for(num equals to 80; num!=0; num++)
Write num++
getchar();
return 0;
}
a. None of the mentioned options
b. Error
c. 140
d. Infinite loop
Ans Infinite loop
5. Consider the following given algorithm and identify the task performed by this
int main()
{

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
int n = 1;
do
{
printf("%d", n);
n--;
if (n > 15)
continue;
} while (0);
return 0;
}
a. 15
b. 1
c. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Ans 1
6. What will be the output of the following pseudocode?
#include <stdio.h>
using namespace std;
int main()
{
printf("%d", 'X' > 'x');
return 0;
}
a. 0
b. X
c. X
d. 1
Ans 0
7. What will be the output of the following pseudocode?
#include <stdio.h>
using namespace std;
int main()
{
for (int x = 10; x = 0; x--) {
int z = x & (x >> 1);
if (z)
printf("%d", x);
}
}
a. 1 2 7
b. 10 9 8
c. 7 6 3
d. 9 6 3
Ans 7 6 3
8. What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int x = 10, y = 20, z = 30;

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
z = x = y;
printf("%d", z);
return 0;
}
a. 10
b. 30
c. Error
d. 20
Ans 20
9. What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int x = 210;
int y = 0;
;
;
printf("%d", y);
;
;
return 0;
}
a. 0
b. 210
c. Run Time Error
d. Compile Time Error

Ans 0

10. What will be the output of the following pseudocode for the given set of input?
#include <stdio.h>
void main()
int a = 1.0, b = 2, c = 3.12;
char d = 0.0;
if (a, b, c, d)
{
printf("KHUDSOLVEKRO");
}
}
a. No output
b. Error
c. KHUDSOLVEKRO
d. 1.0

Ans No output

1. What will be the output of the pseudocode?


#include <stdio.h>
void main()
{

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
int a = 100;
printf("%0 %x", a);
}
a. A
b. %x
c. 100
d. %0

Ans %x

2. Observe the code carefully and choose the correct output of this code.
#include <stdio.h>
int main()
{
typedef int score;
score result = 0.00;
printf("%d", result);
return 0;
}
a. 0.0
b. 0.00
c. 0.000000
d. 0(Zero)

Ans: 0(Zero)

3. Observe the code carefully and choose the correct output of this code.
#include <stdio.h>
int main(){
float m = 0.0;
long int n = 10;
printf("%d", sizeof(m) == sizeof(m+n));
return 0;
}
a. 10
b. 10.0
c. 10+0.0
d. 0(Zero)

Ans:- 0(Zero)

4. What will be the output of following pseudo code?


#include <stdio.h>
int main()
{
int any = 10;
printf("%d", any);
return 0;
}
a. 10

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
b. 120
c. 320
d. 160

Ans:- 320

5. Observe the code carefully and choose the correct output of this code.
#include <stdio.h>
int main()
{
int tell = 5.0, scl =1*10;
do {
scl /= tell;
} while(tell--);
printf ("%d\n", scl);
return 0;
}
a. Floating-point exception
b. 10
c. 5.0
d. 10.0

Ans:- Floating-point exception

6. What will be the output of the following c code?


#include <stdio.h>
int main()
{
int b = 80;
char a= (char)b;
int i=sizeof(a);
printf("%d", i);
}
a. 1
b. 80
c. 2
d. 1

Ans 1

7. what will be the output of following c code?


#include <stdio.h>
int main()
{
printf("%f", main);
return 0;
}
a. 0(Zero)
b. 0.000
c. 0.00000

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
d. 0.000000

Ans 0.000000

8. What will be the output of the following pseudo-code for input 7?


1. Read the value of N.
2. Set m=1,T=0
3. If m >N
4. Go to line No. 9
5. Else
6. T= T+m
7. m=m+1
8. Go to line no.3
9. Display the value of T
10.Stop
a) 28
b) 32
c) 56
d) 76
Ans 28
9. what will be the output of the following algorithm for Num=10?
#include <stdio.h>
int main()
{
float i;
i = 1;
printf("%d", i);
return 0;
}
a. Garbage value
b. 1
c. (0)Zero
d. Error
Ans Garbage Value
10. Consider the following pseudocode.
#include <stdio.h>
int main()
{
int a,b;
a=15;
b=25;
for(int i=0;i<5;i++)
{
if(i%2==0)
++a;
else
++b;
}
printf("%d %d",a,b);

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
}
What is the value of b at the end of the pseudocode?
a. 15 25
b. 18 27
c. 27 18
d. 25 15
Ans 18 27
1. What will be the output of the following pseudocode?
integer p, q, г
Set p = 4;
q = 6;
r = 2;
p = p + q + г - 7;
q=p+r-7;
if (p > q)
Print Hello
else
Print Hi
a. Hello
b. Hi
c. Error
d. Hello Hi
Ans Hello
2. What will be the output of the following pseudocode if num=4 and element of the array are
1,2,3,4,5?
#include <stdio.h>
integer fun (int a[], int num)
integer x;
if (num is equal to 1)
return a[0];
else
x = fun (a, num 1);
if (x == a[num - 1])
return x;
else
return a[num - 1];
End the function fun ()
a. 1
b. 3
c. 4
d. 5
Ans 4
3. What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int p = 2, q = 3;
for (int i = 0; i <= 6; i = i + 2){

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
p = p + q + 1;
p = p + q;
q = p-q;
printf("%d ",9);
}
}
a. 30 10 27 70
b. 5 15 39 99
c. 13 10 47 70
d. 13 10 27 70
Ans 5 15 39 99
4. What will be the output of the following code:
#include <stdio.h>
int main()
{
static float i=3;
if(--i){
main();
printf("%f", i);
}
}
a. 0.000000 0.000000
b. Error
c. Segmentation Fault
d. 3.0 3.0
e. Ans 0.000000 0.000000
5. What will be the output of the following code?
#include <stdio.h>
int main()
{
int get_the_val;
get_the_val = (100, 256, 3.3);
printf("%d", get_the_val);
return 0;
}
a. 3
b. 3.3
c. 100
d. 256
Ans 3
6. What will be the output of the following pseudocode?
#include <stdio.h>
int main()
{
int i,j;
for(i=0;i<5;i++)
{
for(j=0;j<i;j++)

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
{
}
printf("%d ",i+j);
printf("\n");
}}
a. 1
23
345
4567
b. 1
22
333
4444
c. 1
12
123
1234
d. Error
Ans 1
23
345
4567

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


Integer n, rev, rem, orig;
Set n=1331; rev=0;
Repeat while n Not Equals 0
Set orig=n; rem=n%10; rev=(rev*10)+rem; n=n/10; End while if(orig is Equal to rev)
Print Palindrome
else
Print Not Palindrome
End if
a. Not Palindrome
b. Run Time Error
c. Palindrome
d. Compile Time Error
Ans Palindrome
8. What will be the output of the pseudocode?
#include <stdio.h>
int main()
{
static int val = 5.2;
printf("%d ",val--);
if(1.25)
main();
}
a. 1.5
b. 5.2

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
c. 4.2
d. Infinite loop
Ans Infinite loop
9. What will be the output of the following pseudo code?
#include <stdio.h>
int main()
{
int a=97,b=97,c=98;
if(a>b && a>c)
{
}
printf("%d ",a);
if(b>a && b>c)
{
}
printf("%d ",b);
if(c>a && c>b)
{
}
printf("%d ",c);
}
a. 98
b. c
c. b
d. 97
Ans 98
10. What will be the output of the following pseudocode?
integer a,b
Set a=2; b=90
while(b>9)
a = b%2+a
if(a%2!=0)
Print a
else
Print b
b = b/2
End while
a. 3 90 11 3
b. 11 3 3 90
c. 90 3 3 11
d. 3 3 90 11
Ans 90 3 3 11
1. What will be the output of the following pseudocode?
integer a,b,c,x,y,z,p,q,r
Set x=5,y=10, z=15;
Set p=10,q=20,r=30;
a=x+p;
b=y*q;

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
c=r/z;
Print a bc
a. 15 200 0
b. 15 200 20
c. 15 200 2
d. 15 20 2
Ans 15 200 2
2. What will be the output of the following pseudo code when n=3 ?
Integer calc(Integer n);
if(n <- 0)
return 0;
if(n < 1)
return 1;
Print n
calc(n-1);
Print n
End function calc
a. 1 2 3
b. 3 2 1 0
c. 3 2 1 1 2 3
d. Compiler error
Ans 3 2 1 1 2 3

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


#include<stdio.h>
int main()
{
int x=4,y=5, z=6;
if(x+y>z)
{
if(z>y)
{
if(y>x)
{
}
printf("%d",x);
}
}
}
else
{
}
printf("%d",y);
}
}
a. 6
b. 4
c. 5

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
d. Compiler error
Ans 4
4. What will be the output of the following pseudocode ?
#include <stdio.h>
int fun(int x, int y, int z)
{
if(x>y && y>z)
{
}
return fun(y,x,z);
if(y>z && z>x)
{
}
return fun(z,y,x);
if(z>y && z>x)
{
}
return fun(x,y,z);
}
int main()
{
int a=10,b=15,c=20;
a=a+b;
b=a+c;
c=b+c;
fun(a,b,c);
}
a. 25 20 35
b. Runtime error
c. 10 15 20
d. None of the above
Ans Runtime error
5. What will the output of the following code ?
#include<stdio.h>
int fun(int i)
{
if(i%2==0)
return i;
else
return fun(i-1);
}
int main()
{
int a=11;
printf("%d", fun(a));
}
a. 0(zero)
b. 10

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
c. 1
d. None of the above
Ans 10
6. What will be the output of the following code
#include<stdio.h>
int fun(int i)
{
if(i==0)
return 0;
else if(i%2==0)
return fun(i-1);
else
return fun(i-1);
}
int main()
{
int a=11;
printf("%d",fun(a));
}
a. 10 9 8 7 6
54321
b. 10
c. 0(Zero)
d. 1
Ans 0(zero)
7. What will be the necessary condition to get the desired element from a given array by using
the following algorithms?
If LOC-1 do ITEM NOT FOUND
Do_Something(DATA, N, ITEM, LOC)
initialize Counter set LOC=0, LOW=0, HI= N-1
[Search for item]
Repeat while LOWS HI
MID = (LOW+HI)/2
IF ITEM = DATA[MID] do
LOC+MID
Return LOC
IF ITEM = DATA [MID}
HI MID-1 LOW MID+1
ELSE
LOW =MID-1
a. the elements should contain
more than one element
b. The array should contain
more than one element
c. The elements is an array should be in the sorted form.
d. No pre-condition is required
for the algorithm to work
ans The elements is an array should be in the sorted form.

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
8. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 12, y = 10, z = 13;
x+y>z ? printf("%d", z);
}
a. Value of x
b. Value of y
c. Value of z
d. None of the above
Ans none of the above
9. What will be the output of the following C code?
Set a=3; b=5;c=1;
a=a+b+c/2;
b=a+b/2;
if(a>b)
Print Prime Mock
else
Printf Prime Video
a. Prime Video
b. Prime Mock
c. Error
d. None of the above
Ans Prime vidow
10. Consider the following given code and predict its output.
main()
int num[ ]={1,4,8,12,16);
int *a,*b;
int i;
a=num;
b=num+2;
i=*a++;
printf("%d,%d,%d\n", i, *a, *b);
a. 1,4,8
b. 4,1,8
c. 2,1,8
d. 4,4,8
Ans 1,4,8
1. What will be the output of the following code?
#include <iostream>
using namespace std;
int main ()
{
int x = 0, y = 1;
for (; y; cout <<< ++x <<< y++ <<< "")
{ x = y++ <= 15;
}

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
return 0;
}
a. 31,71,41,60,21
b. 22 23 44 55
c. 21 31 51 61
d. Infinite loop
Ans Infinite loop
2. What will be the output of the following code?
#include<stdio.h>
int main ()
{
int i = 1, j;
for (;;)
{
i++;
if (i)
j = -1;
if (i < 5)
printf ("Royal Pass ", i++);
else
break;
}
return 0;
}
a. will print Royal Pass 4 times
b. No, compile error but it will run into an infinite loop printing Royal Pass.
c. No, compile error but it'll not print Royal X Pass.
d. Compile-time error.
Ans will print Royal Pass 4 times
3. What will be the output of the following code?
#include<stdio.h>
int main ()
{
int x = 4, y = 0;
int z;
z = (x++ + ++y + y++, x++);
printf ("%d\n", z);
return 0;
}
a. 5
b. zero - 'O'
c. compiler error
d. undefine behavior due to the order of evolution can be different
ans 5
4. What will be the output of the following code?
#include <stdio.h>
int f(int n)
{

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
if (n==0)
return 1;
else
return f(n-1);
}
int main ()
{
printf ("Result: %d", f (50));
return 0;
}
a. Run time error
b. compile time error
c. Result:01 2 3 4 .... 50
d. Result:1
Ans Result:1
5. What will be the output of the following C code?
#include <stdio.h>
int f(int n)
{
if (n==0)
return 1;
else
return n+f(n-1);
}
int main
{
printf ("%d", f (10));
return 0;
}
a. compile time error
b. infinite loop
c. 56
d. 55
Ans 56
6. What will be the output of the following C code?
#include <stdio.h>
int main ()
{
int x = 5, y = 4, z = 3;
int a = x<<+1;
int b= y>>+1;
int c = z<<+1;
printf ("%d\n", a);
printf ("%d\n", b);
printf ("%d\n", c);
return 0;
}
a. Error

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
b. 10
4
2
c. 10
2
6
d. 10
2
4
Ans 10
2
6
7. What will be the output of the following C code? [assume it is a 64 bit-computer]
#include <stdio.h>
struct node
{
int data;
int *pointer;
};
int main ()
{
node m;
printf ("%d", sizeof (m));
return 0;
}
a. 4
b. 12
c. 16
d. 5
Ans 16
8. What will be the output for the pseudocode for x=10, y=25
fun(int x, int y)
if(x==0)
return y;
else
return fun(x-1, y+1)
a. 25
b. 9
c. 6
d. None of the above
Ans none of the above
9. What will be the output of the following code?
#include<stdio.h>
int main ()
}
}
int no = 1112, temp, digit, sum = 1;
temp = no;

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
while (no > 0)
{
digit = no % 10;
*sum = sum digit;
no /= 10;
printf ("%d\n", sum);
return 0;
}
a. 25
b. 7
c. 5
d. 2
Ans 2
10. What will be the output of the following C code
#include<stdio.h>
int main ()
{ int x = 21, y = 10, z = 13;
x+y>5 ? (printf ("%d", z)) : (return z);
}
a. Error
b. 10
c. 2
d. 13
Ans error
1. What will be the output of the following pseudo
integer a, b, c;
set a = 11, b = 12, c = 10;
if (b > 0)
b++
else
att
end if
for (each b from 0 to 5)
a=a+1
end for
print (a + c)
a. 26
b. 20
c. 22
d. 24
Ans 26
2. What will be the output of the following C code
#include<stdio.h>
int main ()
{
int a = 0, i = 0, b;
for (i = 0; i < 5; i++)
{

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
a++;
while(a+i<5)
printf ("Hello world\n");
}
printf ("%d", a);
return 0;
}
a. print hello world for 5 times, and then print 6
b. print hello world for 5 times, and then print 1
c. Code will stuck in infinite loop
d. 5
e. Ans Code will stuck in infinite loop
3. What will be the output of the following C code
#include<stdio.h>
void main()
{
int k=4;
int *const p =&k;
int r = 3;
p = &r;
printf("%d", p);
}
a. It will print address of r
b. It will print address of k + address of r
c. It will print address of k
d. Compile time error
Ans compiler time error
4. What will be the output of the following code?
#include<stdio.h>
void main ()
{
int k = 4;
while(k>10)
k=k*k;
k++;
printf ("%d", k);
}
a. 4096
b. 256
c. 16
d. 5
Ans 5
5. What will be the returned value for the pseudo-code for p=22, q=127
fun(int p,int q)
if (p == 1)
return q;
else if (p%2==0)
return fun (p-1,q);

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
else
return 0;
a. 9
b. 6
c. 5
d. None of the mentioned above
6. What will be the output of following code?
#include <stdio.h>
int foo(int a, int b)
int sum = *a + *b;
*b = *a;
return *a Sum *b;
}
int main()
{
int i = 0, j = 1, k = 2, 1;
1 = i++ || foo(&j, &k);
printf("%d %d %d %d", i, j, k, 1);
return 0;
}
a. 1 1 2 1
b. 1 2 2 1
c. 1 2 1 1
d. 1 2 2 2
ans 1 2 1 1
7. Predict the output
#include <stdio.h>
int i;
int main()
{
if (i);
else
printf("else");
return 0;
}
a. Else
b. Zero
c. If
d. Error
Ans else
8. What will be the output of the following algorithm?
Start
Declare a=0, I and b
for I =0 to 3
Increment a by 1
if I = 3 then
print hello
get out of the loop

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
End if
End for
print a
a. 4
b. 1
c. Hello4
d. Hello
Ans hello4
9. What will be the output of the following pseudo code ?
Input x = 5, y = 7
x=x+1;
y=y+1;
x=x+y;
if(x%2==0) print x else print y
a. 14
b. 5
c. 8
d. 10
Ans 14
10. What will be the output of the following pseudocode?
Declare variable x, y
Set x = 0 and y = 1
while(x<5)
print x
x=x+y
x++
End of loop
a. 0 2 4
b. 0 2 3
c. 1 2 4
d. 0 3 8
Ans 0 2 4
1. what will be the output of the following pseudocode?
Set fun = 5
Set goal = 8
Set sum1 = 0
Set n = 2
if (goal is greater than fun): for(n=fun; n<goal; n=n+1)
sum1=sum1+n
else:
Write Error messages
Write sum1
a. 18
b. 15
c. 9
d. 6
Ans 18
2. what will be the output of the following pseudocode?

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
#include<stdio.h>
int main()
{
}
for(printf("NoError"));
a. Compiler error
b. NoError wil get printed 7 times
c. It will not print anything
d. NoError will get printed 6 times
Ans compiler error
3. what will be the output of the following pseudocode?
#include<stdio.h>
int main()
{ fprintf(stdout, "Get Placed");
}
a. error
b. garbage values
c. Get placed
d. Nothing gets printed
Ans Get placed
4. what will be the output of the following pseudocode?
#include<stdio.h>
int main()
{
int date = 100;
const int timeof = date;
printf("%f", timeof);
}
a. nothing gets printed
b. error
c. 100.000000
d. 0.000000
Ans 0.000000
5. Predict the output
#include<stdio.h>
int main()
{
printf("%nxy");
printf("%bxy");
printf("%rxy");
}
a. Nothing gets printed
b. Error
c. Xy%bxy%rxy
d. %nxy%bxy%rxy
Ans Xy%bxy%rxy
6. What will be the output of the following code
#include<stdio.h>

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
int main()
{
int i = 065,j = 65;
printf("%d,%f",i,j);
}
a. 065,65
b. 53,0.000000
c. 65,65
d. Error
Ans 53,0.000000
7. Read the code carefully and answer what will be the output:
#include <stdio.h>
int main()
{
int p,q=105;
p=printf("%d",q);
printf("%d",p);
}
a. 105 4
b. 105 3
c. Error
d. 3
Ans 105 4
8. Read the code carefully and answer what will be the output:
#include <stdio.h>
int main()
{
int k=25;
if (printf("%d",k))
printf("%d",k);
else
printf("Prime mock");
}
a. Prime mock
b. 25 25
c. Value error
d. 2525
Ans 2525
9. Read the code carefully and answer what will be the output
#include <stdio.h>
int main()
int p=3;
switch(p)
{
case 1:
printf("Prepinsta\n");
break;
case 2:

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf
Capgemini Pseudo Coding Questions
printf("Hello world\n");
case 3:
continue;
case 4:
printf("Capgemini\n"); break;
}
}
a. Infinite loop
b. Error
c. Prepinsta
d. Prepinsta hello world Capgemini
Ans error
10. Predict the output
Declare variable x, y and 1
Set x =8 and y =1
for(int i=1; i<=4; 1=1+1)
print x
x=x+y
y = x/y
End of loop
a. 1 0 2 4
b. 0 1 3 8
c. 0 1 2 4
d. 0 1 2 3
Ans 0 1 2 4

Please subscribe :- youtube.com/@teknouf


Follow – Instagram.com/tekno.uf

You might also like