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 hexadecimal value of the given number in VBScript?

A - Using Oct function

B - Using Hex function

C - Using Rnd function

D - Using Sqr function

Answer : B

Explaination

Using Hex function, which returns the hexadecimal value of the given number.

Q 5 - How will you trim the leading as well as trailing spaces of a string using VBScript?

A - Using Trim function

B - Using Len function

C - Using Replace function

D - Using Space function

Answer : A

Explaination

Using Trim function, which returns a string value after removing both leading and trailing blank spaces.

Q 6 - What StrComp(String1, String2) returns if String1 is greater than String2 in lexicographical order?

A - -1

B - 0

C - 1

D - None of the above.

Answer : C

Explaination

StrComp(String1, String2) returns 1 if String1 is greater than String2 in lexicographical order.

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