What will be contained in Msg if grade entered by user is ‘d’? grade=grade.Text.ToUpper If grade==”A” Msg =”Excellent” ElseIf grade==”B” Msg=”Very Good” ElseIf grade==”C” Msg=”Good” ElseIf grade==”D” Msg=”Fair” Else Msg=”Fail” EndIf

Fair
Fail
Good
Excellent

The correct answer is: C. Good

The code snippet is a simple conditional statement that checks the value of the variable grade and assigns a different message to the variable Msg depending on the value of grade. If grade is equal to A, the message Excellent is assigned to Msg. If grade is equal to B, the message Very Good is assigned to Msg. If grade is equal to C, the message Good is assigned to Msg. If grade is equal to D, the message Fair is assigned to Msg. If grade is not equal to any of the above values, the message Fail is assigned to Msg.

In this case, the user entered the grade d. Since d is equal to D, the message Good is assigned to Msg.

The other options are incorrect because they are not the messages that are assigned to Msg when the user enters the grade d.

Exit mobile version