Question 21
EasyWhat will be printed by the following pseudocode?
Print 25 ^ 25
- A.
25
- B.
50
- C.
1
- D.
0
Sign up free to see the answer and a step-by-step explanation.
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 25 ^ 25
25
50
1
0
Sign up free to see the answer and a step-by-step explanation.
What will be the output of the following pseudocode?
Print (9 & 3) | 4
7
13
5
4
Sign up free to see the answer and a step-by-step explanation.
What will be the output of the following pseudocode?
Integer n = 40, c = 0
while ((n & 1) == 0)
n = n >> 1
c = c + 1
end while
Print c
5
40
3
2
Sign up free to see the answer and a step-by-step explanation.
What is the output of this pseudocode?
Print 1 << 10
10
11
100
1024
Sign up free to see the answer and a step-by-step explanation.
What is the output of this pseudocode?
Print (13 >> 2) & 1
3
1
13
0
Sign up free to see the answer and a step-by-step explanation.
What will be printed by the following pseudocode?
Integer n = 10
n = n ^ (1 << 1)
Print n
11
12
10
8
Sign up free to see the answer and a step-by-step explanation.
What is the output of this pseudocode?
Print 7 | 8 | 16
16
15
31
24
Sign up free to see the answer and a step-by-step explanation.
What will be printed by the following pseudocode? (& is bitwise AND, ^ is bitwise XOR.)
Integer p = 12, q = 10
Print (p & q) + (p ^ q)
8
14
18
22
Sign up free to see the answer and a step-by-step explanation.
What will be the output of the following pseudocode?
Integer n = 29, c = 0
while (n > 0)
c = c + (n & 1)
n = n >> 1
end while
Print c
4
5
3
29
Sign up free to see the answer and a step-by-step explanation.
What will be the output of the following pseudocode?
Integer a = 6, b = 9
a = a ^ b
b = a ^ b
a = a ^ b
Print a, b
9 6
6 9
15 15
0 0
Sign up free to see the answer and a step-by-step explanation.