What is output by the following C# code segment? int temp; temp = 200; if ( temp
ID: 3905414 • Letter: W
Question
What is output by the following C# code segment?
int temp;
temp = 200;
if ( temp > 90 )
Console.WriteLine( "This porridge is too hot." );
if ( temp < 70 )
Console.WriteLine( "This porridge is too cold." );
if ( temp == 80 )
Console.WriteLine( "This porridge is just right!");
---------------------------------------
This porridge is too hot.
This porridge is too cold.
This porridge is just right!
None of the above.
A.This porridge is too hot.
B.This porridge is too cold.
C.This porridge is just right!
D.None of the above.
Explanation / Answer
Answer: A
As the value of the variable "temp" is 200. If satisfies the first condition, the string "The porridge is too hot" gets printed.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.