VBScript Online Quiz


Advertisements

Following quiz provides Multiple Choice Questions (MCQs) related to VBScript Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Which of the following is a valid scope in VBScript?

A - Dim

B - Public

C - Private

D - All of the above.

Answer : D

Explaination

All of the above are valid scopes in VBScript.

Q 2 - Which of the following operator can be used to do an XOR operation in VBScript?

A - ~

B - ^

C - XOR

D - None of the above.

Answer : C

Explaination

XOR is used to do an XOR operation.

Q 4 - How will you get a random number between 0 and 1 in VBScript?

A - Using Oct function

B - Using Hex function

C - Using Rnd function

D - Using Sqr function

Answer : C

Explaination

Using Rnd function,which returns a random number between 0 and 1.

Q 5 - How will you replace a string with another string using VBScript?

A - Using Trim function

B - Using Len function

C - Using Replace function

D - Using Space function

Answer : C

Explaination

Using Replace function, which returns a string after replacing a string with another string.

Q 6 - How will you split a string into an array in VBScript?

A - Using ReDim statement

B - Using LBound function

C - Using UBound function

D - Using Split function

Answer : D

Explaination

Using Split function, which returns an array that contains a specified number of values. Split will be based on a Delimiter.

Answer : A

Explaination

Set obj = CreateObject("Scripting.Dictionary") creates an object.

Q 8 - Which of the following statements destroys an object in VBScript?

A - delete obj

B - Set obj = Nothing

C - Both of the above.

D - None of the above.

Answer : B

Explaination

Set obj = Nothing destroys an object.

Q 10 - Which of the following is used to get error details in VBScript?

A - Err.Number

B - Err.Description

C - Both of the above.

D - None of the above.

Answer : C

Explaination

Err.Number gives the error number and Err.Description gives error description.

vbscript_questions_answers.htm

Useful Video Courses


Video

VB.NET Masterclass: Learn Visual Basic and VBScript

63 Lectures 4 hours

Frahaan Hussain

Advertisements