Question Detail

COM 101 COM 101 Past Questions Objective Question

Question

52. Dim name As String Dim Grade As Char Dim Mark As Integer Mark = 50 Name = "John" If name <> "John" & Mark = 50 Then Grade = "A1" Elseif name = "John" and Mark <> 50 Then Grade = "B2" Elseif name = "John" and Mark = 50 Then Grade = "C4" End if What will be the value of Grade at runtime?
Options
A 50
B A1
C B2
D C4
Correct Answer
Correct Answer

Option D is the correct answer.

Detailed Explanation

Name is 'John' and Mark = 50, so the third condition is true, setting Grade = 'C4'.

Hint

Check which condition matches the variable values.

Question Info