Time: 00:00:00

Question #1

What will be the value of s if n=127?

Read n
i=0,s=0
Function Sample(int n)
while(n>0)
r=n%l0
p=8^i
s=s+p*r
i++
n=n/10
End While
Return s;
End Function
A
27
27
B
187
187
C
87
87
D
120
120
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Time: 00:00:00

Question #2

What will be the value of s if N=20?

Read N
Function sample(N)
s = 0, f = 1, i=1;
Do Until i <= N
f = f * i;
s = s +(i / f);
i=i+1
End Do
return(s);
End Function
A
666667
666667
B
Infinite Loop
Infinite Loop
C
708333
708333
D
716667
716667
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Time: 00:00:00

Question #3

What will be the output if limit = 6?

Read limit
n1 = 0, n2= 1, n3=1, count = 1;
while count <= limit
count=count+1
print n3
n3 = n1 + n2
n1 = n2
n2 = n3
End While
A
112358
112358
B
12358
12358
C
123581321
123581321
D
12358132
12358132
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

112358

Start

Time: 00:00:00

Question #4

What will be the value of even_counter if number = 2630?

Read number
Function divisible(number)
even_counter = 0, num_remainder = number;
while (num_remainder)
digit = num_remainder % 10;
if digit != 0 AND number % digit == 0
even_counter= even_counter+1
End If
num_remainder= num_remainder / 10;
End While
return even_counter;
A
3
3
B
4
4
C
2
2
D
1
1
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Time: 00:00:00

Question #5

What will be the value of t if a = 56 , b = 876?

Read a,b
Function mul(a, b)
t = 0
while (b != 0)
t = t + a
b=b-1
End While
return t;
End Function
A
490563
490563
B
49056
49056
C
490561
490561
D
None of the mentioned
None of the mentioned
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Time: 00:00:00

Question #6

Code to sort given array in ascending order:




Read size
Read a[1],a[2],…a[size]
i=0
While(i<size)
j=i+1
      While(j<size)       
            If a[i] < a[j] then           
t= a[i];
a[i] = a[j];
a[j] = t;

End If
j=j+1
End While
i=i+1
End While
i=0
While (i<size)
print a[i]
i=i+1
End While



A
Line 4
Line 4
B
Line 6
Line 6
C
Line 7
Line 7
D
No error
No error
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Time: 00:00:00

Question #7

What is the time complexity of searching for an element in a circular linked list?
A
O(n)
O(n)
B
O(nlogn)
O(nlogn)
C
O(1)
O(1)
D
None of the mentioned
None of the mentioned
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Time: 00:00:00

Question #8

In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is
A
log 2 n
log 2 n
B
n⁄2
n⁄2
C
log 2 n – 1
log 2 n – 1
D
n
n
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Time: 00:00:00

Question #9

Which of the following will give the best performance?
A
O(n)
O(n)
B
O(n!)
O(n!)
C
O(n log n)
O(n log n)
D
O(n^C)
O(n^C)
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Time: 00:00:00

Question #10





How many times the following loop be executed?

{

ch = ‘b’;
while(ch >= ‘a’ && ch <= ‘z’)
ch++;
}








 



A
25
25
B
26
26
C
1
1
Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Buy Capgemini Pseudo Code Paid Materials

Join Capgemini Online Classes

Your Quiz-1a ;Percentile Percentile (0%)

You can check your score after Login/Signup

Your global Capgemini Ranking

-

Your Capgemini- Pseudo Code Ranking

-

Your Quiz-1a ;Percentile Ranking

-

The percentile data will be refreshed at 11:59 PM everyday

Result

Result

Completed - 0/10

Average time Per Question - 0