Question 11
EasyWhat will be printed by the following pseudocode?
Print 20 >> 2
- A.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Pseudocode and Output Prediction
What will be printed by the following pseudocode?
Print 20 >> 2
18
80
5
10
Sign up free to see the answer and a step-by-step explanation.
What will be the output of the following pseudocode?
Print 3 << 4
48
34
12
7
Sign up free to see the answer and a step-by-step explanation.
What will be the output of the following pseudocode?
Integer x = 5
x = x | 8
Print x
13
8
5
40
Sign up free to see the answer and a step-by-step explanation.
What will be printed by the following pseudocode?
Integer x = 15
x = x & 6
Print x
15
6
21
9
Sign up free to see the answer and a step-by-step explanation.
What will be printed by the following pseudocode?
Integer n = 22, count = 0
while (n > 0)
count = count + (n & 1)
n = n >> 1
end while
Print count
22
2
4
3
Sign up free to see the answer and a step-by-step explanation.
What does the following pseudocode print?
Integer a = 6, b = 9
a = a ^ b
b = a ^ b
a = a ^ b
Print a, b
0 0
15 15
9 6
6 9
Sign up free to see the answer and a step-by-step explanation.
What is the output of this pseudocode?
Integer n = 16
if ((n & (n - 1)) == 0)
Print "power"
else
Print "not"
end if
0
not
16
power
Sign up free to see the answer and a step-by-step explanation.
What does the following pseudocode print?
Integer n = 7
Print n & 1
8
7
0
1
Sign up free to see the answer and a step-by-step explanation.
What does the following pseudocode print?
Print (5 << 1) + (5 >> 1)
10
11
12
15
Sign up free to see the answer and a step-by-step explanation.
What will be the output of the following pseudocode?
Integer x = 0
for (each i from 0 to 3)
x = x | (1 << i)
end for
Print x
16
8
15
4
Sign up free to see the answer and a step-by-step explanation.