You are on page 1of 5

Question

The output of the following pseudocode is ________

1) Set a = 6, b =3, c = 2
2) if(b>a && a>c && c>b)
3) b=a+1
4) Else
5) a=b+1
6) End-if
7) Print a + b + c
Question
The output of the following pseudocode is ________

1) Set a = 6, b =3, c = 2
2) if(b>a && a>c && c>b)
3) b=a+1
4) Else
5) a=b+1
6) End-if
7) Print a + b + c
Question
Which of the following series will be printed by the given pseudocode?

1) Integer i, j, k, n
2) Set j=1, k=1
3) For (each i from 1 to 5)
4) print k
5) j=j+1
6) k=k+j
7) End-for

a) 1 3 6 10 15
b) 1 2 3 4 5
c) 4 6 8 10
d) 1 1 2 3 5
Question
What will be the output of the following pseudocode if a=10 and b=6?

1) Integer func (Integer a, Integer b)


2) Integer temp
3) While(b)
4) temp = a MOD b
5) a = b
6) b = temp
7) End-while
8) return a
9) End-function func()

a) 2
b) 4
c) 3
d) 1
Question
What would be the output of the following pseudocode?

1) Integer i, j, k
2) Set k = 6
3) For (each i from 1 to 1)
4) For (each j from the value of i to 1)
5) print k+1
6) End-for
7) End-for

a) 2
b) 6
c) 7
d) 5

You might also like