Question Detail

COM 101 COM 101 Past Questions Objective Question

Question

State how to declare a variable in VB?
Options
A Dim variable name As Datatype.
Correct Answer
B Dim Datatype As variable name.
C Dim basic variable name As Datatype.
D Dim input variable name As Datatype.
Correct Answer

Option A is the correct answer.

Detailed Explanation

In Visual Basic, the correct syntax to declare a variable is: Dim VariableName As DataType

Hint

Keyword 'Dim' comes first, then the name, then 'As', then the type.

Question Info