Consider the following code segment.
int x;
x = 53;
if (x > 10){
Console.Write(“A”) ;
}
if (x > 30){
Console.Write(“B”) ;
}
else if (x > 40){
Console.Write(“C”) ;
}
if (x > 50){
Console.Write (“D”) ;
}
if (x > 70){
Console.Write (“E”) ;
}
What is output when the code is executed?
In the following code segment, you may assume that a, b, and n are all type int.
if (a != b && n / (a - b) > 90){
/* statement 1 */
}else{
/* statement 2 */
}
/* statement 3 */
What will happen if a == b is false?
Consider the following code segment. Assume num is a properly declared and initialized int variable.
if (num > 0){
if (num % 2 == 0){
Console.WriteLine("A");
}else{
Console.WriteLine("B");
}
}
Which of the following best describes the result of executing the code segment?