What will be displayed from executing the following segment of code? You may
assume testScore has a value of 90.
int testScore;
if (testScore < 60); // Note the semicolon.
Console.WriteLine("You failed the test!");
if (testScore > 60)
Console.WriteLine("You passed the test!");
else
Console.WriteLine("You need to study for "
+ "the next test!");
a. You failed the test!
b. You passed the test!
c. You failed the test!
You passed the test!
d. You failed the test!
You need to study for the next test!
e. none of the above
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.