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 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 check if two numbers are equal or not in VBScript?

A - !=

B - <>

C - not

D - None of the above.

Answer : B

Explaination

<> operator is used to check if two numbers are equal or not.

Q 3 - How will you format a number upto 3 decimal places in VBScript?

A - Using FormatNumber Function

B - Using FormatPercent function

C - Using Int function

D - Using Log function

Answer : A

Explaination

Using FormatNumber function, which would return an expression formatted as a number.

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 trim the spaces on the left of a string using VBScript?

A - Using Lcase function

B - Using Ucase function

C - Using Ltrim function

D - Using Rtrim function

Answer : C

Explaination

Using Ltrim function, which returns a string after removing the spaces on the left side of the specified string.

Q 6 - How will you increase the size of an array in VBScript?

A - Using ReDim statement

B - Using LBound function

C - Using UBound function

D - Using Split function

Answer : A

Explaination

Using ReDim statement, we can declare dynamic-array variables and allocate or reallocate storage space.

Answer : B

Explaination

Using Filter function, returns a zero based array that contains a subset of a string array based on a specific filter criteria.

Q 10 - What is the output of A + B in VBScript if A = "VB" and B = "Script"?

A - VBScript

B - Error

Answer : A

Explaination

+ operator concatenates two Values if values are string. So A + B will give VBScript.

vbscript_questions_answers.htm
Advertisements