VBScript stands for the Visual Basic Scripting that forms a subset of the Visual Basic for Applications (VBA). Candidates can get VBScript Quiz from this web page. Furthermore, you can practice this VBScript Quiz and get a bright idea about the VBScript Online Test concept. In the same way, we provide interactive VBScript Multiple Choice Questions for the benefit of students preparing for exams and can attempt the quiz easily. Follow the page which gives you the instructions for the test as well as gain good knowledge in practicing the test. Furthermore, you can also know the overview of the VBScript MCQ topic too.
Details About VBScript Quiz
Quiz Name | VBScript |
Category | Technical Quiz |
Number of Questions | 11 |
Time | No Time Limit |
Exam Type | MCQ (Multiple Choice Questions) |
Contenders can check the details necessary for the VBScript MCQ Online Test. Also, you will find more information about the VBScript Quiz. Moreover, candidates can grab the details like the number of question, and even the type of the test. You can know the total number of questions for the test too.
Instructions Of VBScript Quiz
- There are 11 questions for the VB Script MCQ.
- Only one mark given for each question in the exam.
- Meanwhile, check that there is no negative marking.
- Do not refresh the page in the middle of the test.
- Hit on the submit button after answering all the questions.
VBScript Online Test
Which of the following is NOT a valid data type in VBScript?
A) String
B) Integer
C) Boolean
D) Array
Answer: D
Explanation: VBScript supports data types such as String, Integer, and Boolean, but Array is not a data type in VBScript. It is a collection of values of the same data type.
What is the correct syntax for declaring and initializing a variable in VBScript?
A) int x = 10
B) x as Integer = 10
C) Dim x : x = 10
D) x = Integer(10)
Answer: C
Explanation: In VBScript, the correct syntax for declaring and initializing a variable is by using the “Dim” keyword, followed by the variable name, colon (:) and then the value.
Which operator is used for exponentiation in VBScript?
A) ^
B) **
C) ^
D) **
Answer: A
Explanation: In VBScript, the ^ symbol is used for exponentiation, meaning raising a number to a power.
What is the output of the following VBScript code?
a = 10
b = 3
c = a / b
MsgBox c
A) 3.33
B) 3.0
C) 3
D) 3.3333
Answer: B
Explanation: In VBScript, division of two integers results in a floating-point number. So, the output of the code will be 3.0.
Which statement is used to exit a loop prematurely in VBScript?
A) Exit
B) Break
C) Exit For
D) Exit Loop
Answer: C
Explanation: In VBScript, the “Exit For” statement is used to exit a “For” loop prematurely, without completing all iterations.
Which function is used to read input from the user in VBScript?
A) InputBox
B) MsgBox
C) Read
D) Console.ReadLine
Answer: A
Explanation: In VBScript, the InputBox function is used to display a dialog box that allows the user to enter input.
Which of the following is NOT a comparison operator in VBScript?
A) <>
B) !=
C) < D) >=
Answer: B
Explanation: In VBScript, the “!=” is not a valid comparison operator. The correct comparison operator for “not equal to” is “<>”.
What is the correct syntax for a multi-line comment in VBScript?
A) /* … */
B)
C) { … }
D) Rem …
Answer: D
Explanation: In VBScript, multi-line comments are created using the “Rem” keyword followed by the comment text.
What is the output of the following VBScript code?
makefile
Copy code
a = “Hello”
b = “World”
c = a & ” ” & b
MsgBox c
A) Hello
B) World
C) Hello World
D) HelloWorld
Answer: C
Explanation: In VBScript, the “&” operator is used for string concatenation. So, the output of the code will be “Hello World”.
Which function is used to convert a value to a string in VBScript?
A) CStr
B) ToString
C) Convert.ToString
D) Str
Answer: A
Explanation: In VBScript, the CStr function is used to convert a value to a string data type.
What is the correct syntax for a “For Each” loop in VBScript?
A) For i = 1 to 10
B) For Each i in 1 to 10
C) For Each i in Array(1 to 10)
D) For Each i in Range(1 to 10)
Answer: C
Explanation: The correct syntax for a “For Each” loop in VBScript is to use the “For Each” keyword followed by a loop variable, the “in” keyword, and then the collection or array to iterate over. Option C is the correct syntax where “Array(1 to 10)” is used as the collection to loop through.
Which of the following is a valid VBScript function to get the length of a string?
A) GetLength
B) Len
C) Length
D) StrLength
Answer: B
Explanation: In VBScript, the Len function is used to get the length of a string.
What is the correct way to declare and define a function in VBScript?
A) Function myFunction()
B) Function myFunction
C) Function myFunction()
D) myFunction()
Answer: A
Explanation: The correct way to declare and define a function in VBScript is to use the “Function” keyword followed by the function name and parentheses for parameter declaration, and then use parentheses again for function definition. Option A is the correct syntax.
Which of the following is a valid VBScript loop structure?
A) While-Do
B) Do-While
C) Until-Loop
D) Loop-Until
Answer: B
Explanation: In VBScript, the correct loop structure is “Do-While” or “Do-Until”, where the loop condition is checked after the loop body is executed.
What is the correct syntax for a “Select Case” statement in VBScript?
A) Case value
B) Select Case value
C) If value = Case
D) Case Select value
Answer: B
Explanation: The correct syntax for a “Select Case” statement in VBScript is to use the “Select Case” keyword followed by the value to be evaluated.
Which function is used to convert a string to lowercase in VBScript?
A) Lower
B) ToLower
C) LCase
D) ConvertToLower
Answer: C
Explanation: In VBScript, the LCase function is used to convert a string to lowercase.
What is the correct syntax to include an external VBScript file in another VBScript file?
A) #include “file.vbs”
B) Import “file.vbs”
C) Include “file.vbs”
D) Attach “file.vbs”
Answer: A
Explanation: The correct syntax to include an external VBScript file in another VBScript file is to use the “#include” directive followed by the file name in double quotes.
Which statement is used to raise an error in VBScript?
A) Raise
B) Error
C) Throw
D) Err.Raise
Answer: D
Explanation: In VBScript, the “Err.Raise” statement is used to raise an error with a specific error number and description.
What is the default data type for a variable in VBScript?
A) String
B) Integer
C) Variant
D) Boolean
Answer: C
Explanation: In VBScript, the default data type for a variable is Variant, which can hold any type of data.
Which method is used to display a message in the console window in VBScript?
A) Console.WriteLine
B) MsgBox
C) Print
D) Display
Answer: B
Explanation: In VBScript, the MsgBox function is used to display a message box with a message to the user.
About VBScript
This VBA is a product of the Microsoft which is included not only in other Microsoft products such as MS Office and MS Project but also in the Third Party tool such as AUTO CAD. The key features of the VBScript are
- VBScript is a lightweight scripting language and has a lightning fast interpreter.
- Unlike C++ or Java, VBScript is an object-based scripting language and NOT an Object-Oriented Programming language.
- Moreover, the VBScript, for the most part, is case insensitive.
- Furthermore, it has a straightforward syntax, easy to learn and also easy to implement.
- It uses the Component Object Model to access the elements of the environment while executing.
- Successful execution of VBScript can happen only if it is executed in Host Environments such as Internet Explorer, Internet Information Services, and Windows Scripting Host.
Benefits Of Practicing The VBScript Quiz
Candidates will be more benefited with the practice session of the VBScript Online Test. Also, they can know the correct explanation for each question. So that they can rectify the next time errors. Meanwhile, candidates can improve their skill in logical thinking and coding ability. So, make use of the VBScript Quiz. You can gain better knowledge when compared to the past you have. Contenders can check themselves and can even rate themselves too.
How To Check VBScript Online Test Results
Contenders after proper submission, wait for the results part of the test you have done. The results will be mostly in the form of marks or even ranks. So make sure of it. Also, estimate your knowledge and get the explanation for each question. It is mandatory for every candidate to verify the VBScript Result.
For more updates regarding the Quizzes, keep on watching our Freshers Now site.