Mu Sigma Pseudo Code Quiz – 1

Question 1

Time: 00:00:00
Q1- below is a pseudo code

Set x to 0;

Set n to 1;

while(n<=100)

x=x+n;

n=n+1;

end

write x

What is the output of the above pseudo code?

5050

5050

100

100

4950

4950

5151

5151

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 2

Time: 00:00:00
Q2-Below is a pseudo code
Set x to 1;
Set x1 to 0;
Set x2 to 0;
Set x3 to 1;
While(x<10)
Set x1=x1+x2+x3;
Set x2=x2+x1+x3;
Set x3=x3+x2+x1;
Write x1;
write x2;
write x3;
x=x+1;
In which series is the output

Tribonacci series

Tribonacci series

Fibonacci series

Fibonacci series

Triangular series

Triangular series

Arithmetic series

Arithmetic series

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 3

Time: 00:00:00
Q 3-What will be the output of the following pseudocode?
Integer a,b,c
Set a=6,b=84
while(b>0)
b=b/2
a=a+6
c=a+b
while(c>40)
if(c mod 2 IS EQUAL TO 0)
Print a
else
Print b
c=c/10
End while
End while
Print c

48, 4

48, 4

12, 4

12, 4

12, 1, 4

12, 1, 4

12, 1, 48, 4

12, 1, 48, 4

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 4

Time: 00:00:00
What will be the output of the following pseudocode for i=140?

Integer fun(integer i)
if((i MOD 2) NOT EQUALS 0)
Return i
Else
Return fun(fun(i-1))
End function fun()

None of the mentioned options

None of the mentioned options

138

138

140

140

139

139

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 5

Time: 00:00:00
Consider following given algorithm and identify the task performed by this

bstree(*tree)
{
while((tree->left !=null)&&(tree->right !=null))
{
if(tree-> < tree->root)
bstree(tree->left);
else
return (1);
if(tree->right > tree->root)
bstree(tree->right);
else
return (1);
}
return (0);
}

Bubble sort

Bubble sort

Tests whether a binary tree is a Binary Search Tree

Tests whether a binary tree is a Binary Search Tree

Prim’s algorithm

Prim’s algorithm

None of the mentioned options.

None of the mentioned options.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 6

Time: 00:00:00
What will be the output of the following pseudocode?

Integer a,b
Set a=2, b=50
while(b>0)
a = b MOD 2 +a
if( a MOD 3 IS EQUAL TO 0)
Print (a)
else
Print(b-1)
b=b/5
a=a+1
end while

3,3,3

3,3,3

49,3,1

49,3,1

50, 10, 2

50, 10, 2

50, 3, 2

50, 3, 2

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 7

Time: 00:00:00
What will be the output of the following pseudocode?

Integer a, b, c, d, e
Set a=50 , b=3, c=3
while(c>0)
d=a mod b
e= e + d + a
c= c - 1
End while
Print e

52

52

100

100

156

156

153

153

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 8

Time: 00:00:00
What will be the output of the following pseudocode?

Integer array1[10] = {2, 3, 56, 34}
Integer k, a, j, n
Set a = 3, n = 4
for(each k from 0 to n-1)
Set array1[n] = array1[0]
for(each j from 0 to n-1)
Set array1[j] = array1[j+1]
End for
End for
for(each k from 0 to n-1)
Print array1[k]
End for

56 34 3 2

56 34 3 2

34 2 3 56

34 2 3 56

2 3 34 56

2 3 34 56

None of the mentioned options

None of the mentioned options

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 9

Time: 00:00:00
What will be the output of the following pseudocode?

Integer j,i,count,num
Set j=31, count=0, num=64
while(num NOT EQUALS 0)
if((num&1) is EQUAL to 1)
Jump out of the loop
else
count=count+1
num = num>>1
End while
Print count

6

6

95

95

12

12

5

5

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Question 10

Time: 00:00:00
What will be the output of the following pseudocode for given set of input?

integer a
if((a mod 10) IS EQUAL TO 0)
a=a*2
else if((a mod 5 ) IS EQUAL TO 0)
a=a/5
else
a=a-1
end if

input : a=25, a=16

a=5,a=15

a=5,a=15

a=15,a=20

a=15,a=20

a=25,a=15

a=25,a=15

a=35,a=25

a=35,a=25

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

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

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.