Question 71
HardWhat will be the output of the following pseudocode?
Integer x = 8, y = 3
Print x > y and x - y > 4, x > y or 1 / 0 > 0, not (x < y)
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 the output of the following pseudocode?
Integer x = 8, y = 3
Print x > y and x - y > 4, x > y or 1 / 0 > 0, not (x < y)
true true false
false true true
true error true
true true true
Sign up free to see the answer and a step-by-step explanation.
What is the output of this pseudocode?
Integer a = 1, b = 2, c = 3
a = b = c = a + b + c
Print a, b, c
6 2 3
3 3 3
1 2 6
6 6 6
Sign up free to see the answer and a step-by-step explanation.
What is the output of this pseudocode?
Integer x = 2
Integer r = x * x + x * x * x - x / x + x mod x
Print r
13
12
11
10
Sign up free to see the answer and a step-by-step explanation.
What will be the output of the following pseudocode?
Integer h = 100, c = 0
while (h >= 1)
h = h * 3 / 4
c++
end while
Print c
16
25
15
14
Sign up free to see the answer and a step-by-step explanation.
What does the following pseudocode print?
Integer a = 0xA, b = 012, c = 10
Print a == c, a + c
true 30
false 20
true 20
true 1010
Sign up free to see the answer and a step-by-step explanation.
What will be printed by the following pseudocode?
Integer n = 47
String s = (n mod 2 == 0) ? "even" : "odd"
String t = (n > 50) ? "big" : (n > 40 ? "mid" : "small")
Print s + "-" + t
odd-mid
odd-big
even-mid
odd-small
Sign up free to see the answer and a step-by-step explanation.
What will be the output of the following pseudocode?
Integer s = 0, i
for (each i from 1 to 10)
s = s + (i mod 3 == 0 ? i * i : (i mod 2 == 0 ? i : 0))
end for
Print s
171
150
110
126
Sign up free to see the answer and a step-by-step explanation.
What does the following pseudocode print?
Integer x = 10, y = 20
Boolean b = x == 10 and y == 20 or x == 0 and y == 0
Boolean c = x == 10 and (y == 20 or x == 0) and y == 0
Print b, c
true false
false false
true true
false true
Sign up free to see the answer and a step-by-step explanation.
What will be printed by the following pseudocode?
Integer a = 9
Integer b = a++ + ++a
Print a, b
11 19
10 20
11 20
11 21
Sign up free to see the answer and a step-by-step explanation.
What is the output of this pseudocode?
Integer x = 1
Integer i
for (each i from 1 to 5)
x = x * 2 + (i mod 2 == 0 ? 1 : -1)
end for
Print x
21
31
43
11
Sign up free to see the answer and a step-by-step explanation.