- VBScript Tutorial
- VBScript - Home
- VBScript - Overview
- VBScript - Syntax
- VBScript - Enabling
- VBScript - Placement
- VBScript - Variables
- VBScript - Constants
- VBScript - Operators
- VBScript - Decisions
- VBScript - Loops
- VBScript - Events
- VBScript - Cookies
- VBScript - Numbers
- VBScript - Strings
- VBScript - Arrays
- VBScript - Date
- VBScript Advanced
- VBScript - Procedures
- VBScript - Dialog Boxes
- VBScript - Object Oriented
- VBScript - Reg Expressions
- VBScript - Error Handling
- VBScript - Misc Statements
- VBScript Useful Resources
- VBScript - Questions and Answers
- VBScript - Quick Guide
- VBScript - Useful Resources
- VBScript - Discussion
VBScript Mock Test
This section presents you various set of Mock Tests related to VBScript Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
VBScript Mock Test II
Q 1 - Which of the following function of VBScript converts a given number of any variant subtype to Single?
Answer : D
Explaination
CSng function converts a given number of any variant subtype to Single.
Q 2 - Which of the following function of VBScript converts a given number of any variant subtype to Hexadecimal?
Answer : A
Explaination
Hex function converts a given number of any variant subtype to Hexadecimal.
Q 3 - How will you format a number upto 3 decimal places in VBScript?
A - Using FormatNumber Function
Answer : A
Explaination
Using FormatNumber function, which would return an expression formatted as a number.
Q 4 - How will you format a number in percetage format in VBScript?
A - Using FormatNumber Function
Answer : B
Explaination
Using FormatPercent function, which would return an expression formatted as a percent.
Q 5 - How will you get the integer part of a number in VBScript?
A - Using FormatNumber Function
Answer : C
Explaination
Using Int function, which returns the integer part of the given number.
Q 6 - How will you get the natural logarithm of the given number in VBScript?
A - Using FormatNumber Function
Answer : D
Explaination
Using Log function, which returns the natural logarithm of the given number.
Q 7 - How will you get the octal value of the given number in VBScript?
Answer : A
Explaination
Using Oct function, which returns the octal value of the given number.
Q 8 - How will you get the hexadecimal value of the given number in VBScript?
Answer : B
Explaination
Using Hex function, which returns the hexadecimal value of the given number.
Q 9 - How will you get a random number between 0 and 1 in VBScript?
Answer : C
Explaination
Using Rnd function,which returns a random number between 0 and 1.
Q 10 - How will you get the square root of the given number in VBScript?
Answer : D
Explaination
Using Sqr function, which returns the square root of the given number.
Q 11 - How will you get the absolute value of the given number in VBScript?
Answer : A
Explaination
Using Abs function, which returns the absolute value of the given number.
Q 12 - How will you get the exponent of the given number in VBScript?
Answer : B
Explaination
Using Exp function, which returns the value of e raised to the specified number.
Q 13 - How will you get the first occurrence of one string within another string using VBScript?
Answer : C
Explaination
Using InStr function, which returns the first occurrence of one string within another string. The search happens from left to right.
Q 14 - How will you get the last occurrence of one string within another string using VBScript?
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 15 - How will you convert a string to lower case string using VBScript?
Answer : A
Explaination
Using Lcase function, which returns the lower case of the specified string.
Q 16 - How will you convert a string to upper case string using VBScript?
Answer : B
Explaination
Using Ucase function, which returns the upper case of the specified string.
Q 17 - How will you trim the spaces on the left of a string using VBScript?
Answer : C
Explaination
Using Ltrim function, which returns a string after removing the spaces on the left side of the specified string.
Q 18 - How will you trim the spaces on the right of a string using VBScript?
Answer : D
Explaination
Using Rtrim function, which returns a string after removing the spaces on the right side of the specified string.
Q 19 - How will you trim the leading as well as trailing spaces of a string using VBScript?
Answer : A
Explaination
Using Trim function, which returns a string value after removing both leading and trailing blank spaces.
Q 20 - How will you get length of a string using VBScript?
Answer : B
Explaination
Using Len function, which returns the length of the given string.
Q 21 - How will you replace a string with another string using VBScript?
Answer : C
Explaination
Using Replace function, which returns a string after replacing a string with another string.
Q 22 - How will you fill the string with the specified number of spaces using VBScript?
Answer : D
Explaination
Using Space function, which fills a string with the specified number of spaces.
Q 23 - How will you compare two strings in VBScript?
Answer : A
Explaination
Using StrComp function, which returns an integer value after comparing the two specified strings.
Q 24 - What StrComp(String1, String2) returns if String1 is less than String2 in lexicographical order?
Answer : A
Explaination
StrComp(String1, String2) returns -1 if String1 is less than String2 in lexicographical order.
Q 25 - What StrComp(String1, String2) returns if String1 is same as String2?
Answer : B
Explaination
StrComp(String1, String2) returns 0 if String1 is same as String2.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | A |
3 | A |
4 | B |
5 | C |
6 | D |
7 | A |
8 | B |
9 | C |
10 | D |
11 | A |
12 | B |
13 | C |
14 | D |
15 | A |
16 | B |
17 | C |
18 | D |
19 | A |
20 | B |
21 | C |
22 | D |
23 | A |
24 | A |
25 | B |