Vidyalelo
Computer Science · all questions

Visual Basic MCQs: Test Your Proficiency in Visual Basic Programming
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

689

Questions

22/35

Page

Pick an option on a question to see the right answer and solution.

Is there an error in the below code?

Private _intSide As Integer
Public Property Side As Integer
_intSide=_intSide+2
End Property

Select an option to see the answer and solution.

What will be in Msg after the following code is evaluated?

If 5*3 OrElse 3^2 Then
   Msg="Hi"
Else
   Msg="Bye"
EndIf

Select an option to see the answer and solution.

. . . . . . . . refers to the process of locating and correcting errors.

Select an option to see the answer and solution.

. . . . . . . . variables are not reinitialized each time Visual Invokes a procedure and therefore retains or preserves value even when a procedure ends

Select an option to see the answer and solution.

Which of the following Case clauses is invalid in a Select Case statement whose selectorExpression is an Integer variable named intCode?

Select an option to see the answer and solution.

What will be the content of num, after the code execution; if before code execution num has value 90?

If num<=100
    num=num*2;
ElseIf num>500
   Num=num*3;
Endif

Select an option to see the answer and solution.

Following are the concatenation operator

Select an option to see the answer and solution.

A . . . . . . . . is a special computer that serves webpages.

Select an option to see the answer and solution.

To covert a number from one data type to another, you use the . . . . . . . .

Select an option to see the answer and solution.

Programmers use . . . . . . . . when they need to store related items in an array, even though the members have different data type.

Select an option to see the answer and solution.

A class-level variable is declared using . . . . . . . . keyword.

Select an option to see the answer and solution.

What will be assigned to the dblAvg variable after the code has been executed?

Do While intSub < 4
intTotal = intTotal + intNums(intSub)
intSub = intSub + 1
Loop
dblAvg = intTotal / intSub
Dim intNums() As Integer = {10, 5, 7, 2}. The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.

Select an option to see the answer and solution.

. . . . . . . . determines the type of data stored in a variable.

Select an option to see the answer and solution.

If the elements in two arrays are related by their subscripts, the arrays are called as . . . . . . . . arrays.

Select an option to see the answer and solution.

Which of the following property is used to specify a combo box's style in Visual Basic?

Select an option to see the answer and solution.

. . . . . . . . can be used instead of a Structure statement.

Select an option to see the answer and solution.

In the following Visual Basic code, what will be in msg, if str contains "ik"?

Dim str as String
Dim  msg as String
If str.toUpper="IK" 
   msg="Hi"
Else
   msg="Bye"
EndIf

Select an option to see the answer and solution.

. . . . . . . . format. In this format, the windows associated with the project will stay within a single container known as the parent. Code and form-based windows will stay within the main container form.

Select an option to see the answer and solution.

What will be the output of the following Visual Basic expression?

Financial.Pmt (0.05, 3, 9000)

Select an option to see the answer and solution.

What will be the value of num after the following Visual Basic code is executed?

strName="Veronica Yardley"
num=strName.Length

Select an option to see the answer and solution.