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 - Is it required to specify the type of variable during declaration in VBScript?

A - true

B - false

Answer : B

Explaination

No! Since there is only ONE fundamental data type, all the declared variables are variant by default.

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.

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 the natural logarithm of the given number in VBScript?

A - Using FormatNumber Function

B - Using FormatPercent function

C - Using Int function

D - Using Log function

Answer : D

Explaination

Using Log function, which returns the natural logarithm of the given number.

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.

Q 7 - Can in VBScript, function return multiple values?

A - True

B - False

Answer : A

Explaination

Yes! A function can return multiple values separated by comma as an array assigned to the function name itself.

Answer : C

Explaination

Both of the above options are correct.

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

A - Err.Clear

B - Err.Delete

C - Both of the above.

D - None of the above.

Answer : A

Explaination

Err.Clear clear an error.

vbscript_questions_answers.htm
Advertisements