VBScript Online Quiz



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 - In Which of the following scope, variables are available to all the procedures across all the associated scripts in VBScript?

A - Dim

B - Public

C - Private

D - All of the above.

Answer : B

Explaination

In Public scope, variables are available to all the procedures across all the associated scripts.

Q 2 - Which of the following operator can be used to get the exponent of two numbers in VBScript?

A - EXP

B - ^

C - EXPONENT

D - None of the above.

Answer : B

Explaination

^ opeator is used to get the exponent of two numbers.

Q 3 - Which of the following function of VBScript converts a given number of any variant subtype to Single?

A - CDbl

B - CInt

C - CLng

D - CSng

Answer : D

Explaination

CSng function converts a given number of any variant subtype to Single.

Q 4 - How will you get the last occurrence of one string within another string using VBScript?

A - Using Abs function

B - Using Exp function

C - Using InStr function

D - Using InStrRev function

Answer : D

Explaination

Using InStrRev function, which returns the first occurrence of one string within another string. The search happens from right to left.

Q 5 - What StrComp(String1, String2) returns if String1 is same as String2?

A - -1

B - 0

C - 1

D - None of the above.

Answer : B

Explaination

StrComp(String1, String2) returns 0 if String1 is same as String2.

Q 6 - Which of the following is a correct way to declare array in VBScript?

A - Dim arr1()

B - Dim arr2(5)

C - Dim arr3 = Array("apple","Orange","Grapes")

D - All of the above.

Answer : D

Explaination

All of the above options are correct.

Q 7 - How to pass argument by reference to a function in VBScript?

A - Using ByVal keyword

B - Using ByRef keyword

C - Both of the above.

D - None of the above.

Answer : B

Explaination

If ByRef is specified, then the arguments are sent as by reference when the function or procedure is called.

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
Advertisements