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

Answer : C

Explaination

Variables declared using 'Public' Keyword are available to all the procedures across all the associated scripts. When declaring a variable of type 'public', Dim keyword is replaced by 'Public'.

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

A - MOD

B - %

C - REMAINDER

D - None of the above.

Answer : A

Explaination

MOD opeator is used to get the modulus of two numbers.

Answer : C

Explaination

Using Int function, which returns the integer part of the given number.

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 - How will you convert a string to upper case string using VBScript?

A - Using Lcase function

B - Using Ucase function

C - Using Ltrim function

D - Using Rtrim function

Answer : B

Explaination

Using Ucase function, which returns the upper case of the specified string.

Q 6 - Which of the following is a correct way to assign a value to an array element in VBScript?

A - arr(0) = "VBScript"

B - arr[0] = "VBScript"

C - arr.set(0,"VBScript")

D - None of the above.

Answer : A

Explaination

arr(0) = "VBScript" is the correct way.

Answer : A

Explaination

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

Q 8 - Which of the following event is triggered when an object goes out of scope or when the object is set to Nothing in VBScript?

A - Class_Initialize

B - Class_Terminate

C - None of the above.

D - Both of the above.

Answer : B

Explaination

Class_Terminate is triggered when an object goes out of scope or when the object is set to Nothing.

Q 10 - Is VBScript case sensitive?

A - True

B - false

Answer : B

Explaination

No! VBScript is a case-insensitive language. This means that language keywords, variables, function names and any other identifiers need NOT be typed with a consistent capitalization of letters.

vbscript_questions_answers.htm
Advertisements