Question 1

Time: 00:00:00
What will be the following output of the following code if a = 3, b = 1 ?
Integer func(Integer a,Integer b)
if(a0 OR a>0)
return func(a-1, b)
Else
return a
End if
return b
End function func()

1

1

2

2

-3

-3

8

8

Question 2

Time: 00:00:00
What will be the output of the following pseudo code ?
Integer a, b, c
Set a = 2, b = 11, c = 6
if((b + c) > (c + b))
b = c + a
End if
if((c + b) > (b – c))
c = (9 + 4) + a
End if
Print a + b + c

47

47

21

21

28

28

32

32

Question 3

Time: 00:00:00
What will be the output of the following pseudo code ?
Integer a, b, c
Set a = 8, b = 2, c = 15
for (each c from 2 to 4)
b = 6 + b
End for
b = 10 ^ b
Print a + b

39

39

49

49

38

38

33

33

Question 4

Time: 00:00:00
What will be the output of the following pseudocode for p = 2, q = 2 ?
Integer func(Integer p, Integer q)
if(q>0 OR p>0)
return func(p-1, q-1) + func(q-1, p-1)
Else
return p
End if
return q
End function func()

3

3

2

2

8

8

Zero

Zero

Question 5

Time: 00:00:00
What is output of following code if a=10,b=12.
func(int x , int y)
if(x>1)
func(x-3 ,y-2)
else
print(y)
END if-else
func(a,b)

5

5

10

10

6

6

12

12

Question 6

Time: 00:00:00
What will be the output of the following pseudo code for a = 5, b =4 ?
Integer func(Int a, Int b)
Int c
Set c = a + b
c = c + a
a = b + c
return a + b
End function func()

21

21

28

28

24

24

22

22

Question 7

Time: 00:00:00
What will be the output of the following pseudo code ?
#include
int main()
{
int a=0;
if(a==5);
{
printf(“Hello World\t”);
}
printf(“Good Evening”);
}

Good Evening

Good Evening

Hello World Good Evening

Hello World Good Evening

Hello World

Hello World

None

None

Question 8

Time: 00:00:00
What will be the output of the following pseudo code ?
Integer n
for(n = 5 ; n!=0; n–)
print n
n=n-2
END FOR

5 4 3 2 1

5 4 3 2 1

5 5 5 5 5

5 5 5 5 5

Error

Error

Infinite Loop

Infinite Loop

Question 9

Time: 00:00:00
What will be the output of the following pseudo code for a = 3, b=5, c=4 ?
Integer func(Int a, Int b, Int c)
if((4+7) a)
c = a ^ a
a = 8 + a
Else
a = (4+1) + b
End if
return a + b + c
End function func()

27

27

19

19

16

16

22

22

Question 10

Time: 00:00:00
What will be the output of the following pseudo code ?
Int p, q, r
Set p = 5, q = 10, r = 5
if(r>q OR (q+p)>(p-q))
q = p
p = (r + p) + p
End if
Print p + q + r

25

25

29

29

42

42

10

10

null
null

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.