# HCL Code Input Output Quiz – 1

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

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

Start

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

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

Start

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

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

Start

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

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

Start

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

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

Start

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

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

Start

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

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

Start

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

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

Start

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

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

Start

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

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

Start

["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%

Completed

0/0

Accuracy

0%

Prime

#### Prime Video

Complete Video Course for HCL

For HCL
Get Prime Video

Prime

#### Prime Mock

Topic-Wise Full Mock for HCL

For HCL
Get Prime Mock