What will be the content of Text after the code is executed with id=8? [code]If id==1 Then Text=”Janet”; Elseif id==2 OrElse id==3

Thanh Hoan

New member
What will be the content of Text after the code is executed with id=8?
Code:
If id==1 Then
    Text=”Janet”;
Elseif id==2 OrElse id==3 Then
   Text=”Mark”
ElseIF id==4 Then
    Text=”Jerry”
Else
  Text=”Sue “;
EndIf
A. Janet
B. Mark
C. Jerry
D. Sue
 
Answer: D
Explanation: The value of text after the execution of the code will be Sue. Since id=8 is not satisfied that is it is not found in any of the If or Else if statements, thus it enters the Else statement and makes the value of Text as Sue.
 

Tìm kiếm

Back
Top