Question 11
EasyWhat is the output of this pseudocode?
Integer a = 4, b = 9, c = 7, m
m = a
if (b > m)
m = b
end if
if (c > m)
m = c
end if
Print m
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 is the output of this pseudocode?
Integer a = 4, b = 9, c = 7, m
m = a
if (b > m)
m = b
end if
if (c > m)
m = c
end if
Print m
4
20
7
9
Sign up free to see the answer and a step-by-step explanation.
What is the output of this pseudocode?
Integer y = 1900
if ((y mod 4 == 0 and y mod 100 != 0) or y mod 400 == 0)
Print "leap"
else
Print "not leap"
end if
leap
Error
1900
not leap
Sign up free to see the answer and a step-by-step explanation.
What does the following pseudocode print?
Integer a = 5, b = 5
if (a > b)
Print 1
else if (a < b)
Print 2
else
Print 3
end if
1
2
5
3
Sign up free to see the answer and a step-by-step explanation.
What will be printed by the following pseudocode?
Integer n = 17
if (n mod 2 == 0)
Print "even"
else
Print "odd"
end if
even
odd
17
1
Sign up free to see the answer and a step-by-step explanation.
What does the following pseudocode print?
Integer x = 8, y = 3
if (x > 5)
if (y > 5)
Print "A"
else
Print "B"
end if
else
Print "C"
end if
A
AB
B
C
Sign up free to see the answer and a step-by-step explanation.
What does the following pseudocode print?
Integer a = 10
if (a > 5 or a < 0)
Print "Yes"
else
Print "No"
end if
YesNo
No
Yes
10
Sign up free to see the answer and a step-by-step explanation.
What will be printed by the following pseudocode?
Boolean flag = false
if (not flag)
Print "run"
else
Print "stop"
end if
run
true
stop
false
Sign up free to see the answer and a step-by-step explanation.
What does the following pseudocode print?
Integer x = -12
if (x < 0)
x = -x
end if
Print x
24
-12
0
12
Sign up free to see the answer and a step-by-step explanation.
What is the output of this pseudocode?
Integer age = 65, price
if (age < 12)
price = 50
else if (age >= 60)
price = 70
else
price = 100
end if
Print price
50
100
65
70
Sign up free to see the answer and a step-by-step explanation.
What will be printed by the following pseudocode?
Integer a = 3, b = 4, c = 8
if (a + b > c and a + c > b and b + c > a)
Print "valid"
else
Print "invalid"
end if
invalid
Error
valid
15
Sign up free to see the answer and a step-by-step explanation.