This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1Visual Basic (VB) is primarily classified as which of the following?
Option B
Visual Basic (VB) is a high-level, event-driven programming language developed by Microsoft. It was designed to make Windows application development simple by providing an easy-to-understand syntax and a graphical development environment.
Visual Basic allows programmers to create applications rapidly using drag-and-drop controls such as buttons, text boxes, labels, and menus.
Q: 2Visual Basic is mainly an example of which type of programming?
Option A
Visual Basic is an Event-Driven Programming language. In event-driven programming, program execution depends on events generated by the user or the system.
E.g.:
Private Sub Button1_Click(...) Handles Button1.Click
MessageBox.Show("Welcome to Suraku Academy")
End Sub
The code executes only when the button is clicked.
Q: 3Which of the following symbols is used to represent Integer Division in Visual Basic?
Option B
In Visual Basic (VB), Integer Division is performed using the backward slash () operator. Integer division returns only the whole-number (integer) quotient and discards the fractional part of the result.
| Operator | Operation | Example | Result |
|---|---|---|---|
| + | Addition | 8+2 | 10 |
| - | Subtraction | 8-2 | 6 |
| * | Multiplication | 8*2 | 16 |
| / | Floating-point Division | 10/3 | 3.333333 |
| Integer Division | 103 | 3 | |
| Mod | Remainder (Modulus) | 10 Mod 3 | 1 |
| ^ | Exponentiation | 2^3 | 8 |
| & | String Concatenation | "Suraku" & "Academy" | "SurakuAcademy" |
Q: 4Which of the following Visual Basic controls is used to accept input from the user as well as to display the output?
Option C
In Visual Basic (VB), controls are graphical components placed on a form to interact with the user. Different controls serve different purposes, such as displaying text, accepting user input, or providing selectable options.
A Text Box is the control used to accept input from the user as well as display text or output. Users can type data into a text box, and the program can also display calculated results or messages in the same control.
| Control | Description |
|---|---|
| Label | Displays text, captions, or instructions. It cannot accept user input. |
| Text Box | Accepts input from the user and can also display text or program output. |
| Command Button (Button) | Executes a command or performs an action when clicked. |
| Combo Box | Displays a drop-down list from which the user can select an item or enter text. |
| List Box | Displays a list of items from which the user can select one or more options. |
| Option Button (Radio Button) | Allows the user to select only one option from a group of choices. |
| Check Box | Allows the user to select or deselect one or more independent options. |
| Picture Box | Displays images, graphics, or drawings on a form. |
| Image | Displays pictures with less memory usage than a Picture Box. |
| Frame (Group Box) | Groups related controls such as option buttons together. |
| Scroll Bar | Enables users to scroll through values or content horizontally or vertically. |
| Timer | Executes code automatically at specified time intervals. |
| Progress Bar | Shows the progress of a task or operation visually. |
| Menu | Provides a list of commands or options through a menu bar. |
| Rich Text Box | Displays and edits formatted text. |
Q: 5Which of the following keyword is used to declare a variable in Visual Basic?
Option B
Variables in Visual Basic are declared using the Dim keyword.
E.g.:
Q: 6Which of the following statements are correct?
(i) The ‘Label’ control of Visual Basic can also be used to display outputs.
(ii) The image in an ‘Image Box’ control is stretchable.
(iii) The most common event associated with the ‘Command Button’ control in Visual Basic is the click event.
Option D
In Visual Basic (VB), controls are used to create graphical user interfaces (GUIs). Each control has a specific purpose and supports different properties and events.
A Label control is used to display text such as headings, instructions, messages, or program output. Although users cannot edit its content, the program can change its text during execution to display results.
The Image control has a Stretch property. When this property is set to True, the image automatically resizes (stretches or shrinks) to fit the dimensions of the control.
A Command Button is mainly used to perform an action when the user clicks it. Therefore, the Click event is the most frequently used event for this control.
Q: 7What is the output of the following Visual Basic expression?
Len(“Visual Basic Tutorial”)
Option B
In Visual Basic (VB), the Len() function returns the total number of characters in a string. It counts, alphabets, digits, special characters, spaces. Each character, including a space, is counted as one character.
In the given expression, Len("Visual Basic Tutorial") there are total 21 characters.
| Text | Number of Characters |
|---|---|
| Visual | 6 |
| Space | 1 |
| Basic | 5 |
| Space | 1 |
| Tutorial | 8 |
| Total | 21 |
| Function | Purpose | Example | Output |
|---|---|---|---|
| Len() | Returns the number of characters in a string. | Len("Hello") | 5 |
| UCase() | Converts a string to uppercase. | UCase("hello") | "HELLO" |
| LCase() | Converts a string to lowercase. | LCase("HELLO") | "hello" |
| Left() | Returns characters from the left. | Left("Visual", 3) | "Vis" |
| Right() | Returns characters from the right. | Right("Visual", 3) | "ual" |
| Mid() | Returns characters from the middle. | Mid("Visual", 2, 3) | "isu" |
Q: 8Which of the following is the correct file extension of a Visual Basic .NET source program?
Option A
The source code files of Visual Basic .NET use the .vb extension.
Q: 9Visual Basic was first released by Microsoft in the year _________.
Option A
Visual Basic (VB) is a high-level, event-driven programming language and development environment developed by Microsoft.
It was designed to make Windows application development easier by allowing programmers to create Graphical User Interface (GUI) applications using a simple drag-and-drop approach.
The first version of Visual Basic (Visual Basic 1.0) was officially released by Microsoft in 1991 for the Windows operating system.
| Version | Release Year |
|---|---|
| Visual Basic 1.0 | 1991 |
| Visual Basic 2.0 | 1992 |
| Visual Basic 3.0 | 1993 |
| Visual Basic 4.0 | 1995 |
| Visual Basic 6.0 | 1998 |
| Visual Basic .NET | 2002 |
Q: 10Which of the following was the final version of Visual Basic before the release of Visual Basic.NET?
Option C
Visual Basic (VB) is an event-driven programming language developed by Microsoft for building Windows applications. Before Microsoft introduced the .NET Framework, several versions of Visual Basic were released.
The last standalone version of classic Visual Basic was Visual Basic 6.0 (VB6), released in 1998. After this, Microsoft introduced Visual Basic .NET in 2002, which was built on the .NET Framework and was significantly different from the earlier versions.
You have reached the end of this topic. Continue learning with the next topic below.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.