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 - Which of the following keyword is used to declare a variable in VBScript?

A - variant

B - var

C - dim

D - None of the above.

Answer : C

Explaination

Variables are declared using 'dim' keyword.

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 - How will you format a number in percetage format in VBScript?

A - Using FormatNumber Function

B - Using FormatPercent function

C - Using Int function

D - Using Log function

Answer : B

Explaination

Using FormatPercent function, which would return an expression formatted as a percent.

Q 4 - How will you convert a string to lower case string using VBScript?

A - Using Lcase function

B - Using Ucase function

C - Using Ltrim function

D - Using Rtrim function

Answer : A

Explaination

Using Lcase function, which returns the lower case of the specified string.

Answer : A

Explaination

Using StrComp function, which returns an integer value after comparing the two specified strings.

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.

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

A - Using ByVal keyword

B - Using ByRef keyword

C - Both of the above.

D - None of the above.

Answer : A

Explaination

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

Answer : B

Explaination

The string values should be enclosed within doublequotes.

vbscript_questions_answers.htm
Advertisements