Practice high-yield Computer Science & IT MCQs on Visual Basic — Part 1 with worked academic solutions for PPSC, FPSC, CSS, PMS, NTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
PPSC, FPSC, CSS...
Estimated Time
48 mins
Exam-Level PPSC FPSC CSS PMS NTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Who developed Visual Basic?
Correct Answer: Option C — Microsoft
Detailed Academic Explanation:
Visual Basic was developed by Microsoft . It was created to provide a user-friendly programming environment for building Windows applications. The language evolved over time and had various versions, with Visual Basic 6.0 being one of the most widely used. It allowed developers to create graphical user interfaces and perform rapid application development. While Microsoft's involvement in the development of Visual Basic is well-established, the other options (Apple, Adobe, and Google) were not directly responsible for creating Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 2 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following extension is used to represent the project file in Visual Basic?
Correct Answer: Option A — .vbp
Detailed Academic Explanation:
In Visual Basic, the project file is represented by the extension .vbp . This file type contains information about the project structure, references to other files, and various project settings. The .vb extension is used for individual source code files in Visual Basic. The extensions .cls and .vvb are not commonly associated with Visual Basic project files. Therefore, the correct option is Option A: .vbp .
💡Key Conceptual Anchor:Visual Basic
Question 3 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following applications can be developed using Visual Basic tool?
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
Visual Basic is a versatile programming tool that can be used to develop various types of applications, including: Graphical User Interface (GUI) Applications: Visual Basic is particularly well-suited for creating applications with graphical user interfaces. It provides a drag-and-drop interface for designing windows, buttons, menus, and other visual elements that users interact with. Real-time Applications: Visual Basic can also be used to develop real-time applications, where timely processing and responses are critical. While it might not be the primary choice for extremely high-performance real-time applications, it can certainly handle a wide range of real-time tasks. Character User Interface (CUI) Applications: While Visual Basic's strengths lie in creating GUI applications, it's not limited to that. It can also be used to develop character-based or console applications, although its design principles are more aligned with GUI development. Therefore, the correct option is Option D: All of the mentioned , as Visual Basic is capable of developing applications with graphical user interfaces, real-time capabilities, and even character user interfaces to some extent.
💡Key Conceptual Anchor:Visual Basic
Question 4 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In visual basic language what are the rules of a programming language called?
Correct Answer: Option C — Syntax
Detailed Academic Explanation:
In the context of programming languages, the rules that dictate how programs are written and structured are referred to as Syntax . Syntax defines the correct arrangement of symbols, keywords, and other elements in a programming language to create valid and meaningful code. It governs how statements should be formed and how different parts of a program interact with each other. Option A, Grammar , is related to the structure and rules of a language, but in programming, the more specific term used is Syntax . Option B, Order , is not the appropriate term for describing programming language rules. While the order of statements is important, the term that encompasses all language rules is Syntax . Option D, Rules , is a broad term and does not specifically capture the concept of programming language rules. The term used in this context is Syntax . Therefore, the correct option is Option C: Syntax .
💡Key Conceptual Anchor:Visual Basic
Question 5 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In Visual Basic, if you keep a variable undeclared, it is automatically taken as. . . . . . . . data type.
Correct Answer: Option D — Object
Detailed Academic Explanation:
In Visual Basic , if you keep a variable undeclared, it is automatically taken as the Object data type. This means that the variable can hold any type of value, as Object is the base class for all data types in Visual Basic . While this can provide flexibility, it also means that the compiler won't be able to perform type checking or provide compile-time type-related optimizations for the variable. It's generally considered good practice to explicitly declare the data type of variables to ensure clarity and avoid potential issues related to type conversion. Option A, Int , is not the default data type for undeclared variables in Visual Basic . Option B, Char , is not the default data type for undeclared variables in Visual Basic . Option C, String , is not the default data type for undeclared variables in Visual Basic . Therefore, the correct option is Option D: Object .
💡Key Conceptual Anchor:Visual Basic
Question 6 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In Visual Basic, which of the following is used for coding single-alternative and dual-alternative selection structures?
Correct Answer: Option B — If...Then...Else statement
Detailed Academic Explanation:
In Visual Basic , the If...Then...Else statement is used for coding single-alternative and dual-alternative selection structures. Single-alternative selection: In this structure, a decision is made between two options - one when a certain condition is true, and potentially no action when the condition is false. Dual-alternative selection: Here, the program chooses between two possible actions based on whether a given condition is true or false. The If...Then...Else statement is structured as follows: If condition Then ' Code to be executed if the condition is true Else ' Code to be executed if the condition is false (optional) End If The other options listed are not directly related to selection structures in the same way: Option A, Switch-Case block , is used for handling multiple possible values of an expression, not just single or dual alternatives. Option C, function overloading , is a concept related to defining multiple functions with the same name but different parameter lists. It's not used for creating selection structures. Option D, Recursion , is a technique where a function calls itself. While recursion can be used in coding solutions, it's not specifically tied to single or dual-alternative selection structures. Therefore, the correct option is Option B: If...Then...Else statement .
💡Key Conceptual Anchor:Visual Basic
Question 7 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In Visual Basic, which of the following method converts a string to a number?
Correct Answer: Option B — Tryparse
Detailed Academic Explanation:
In Visual Basic , the TryParse method is used to convert a string to a number while handling potential errors that might occur during the conversion. This method is commonly used when you want to attempt the conversion without causing an exception if the conversion fails. The TryParse method is used as follows: Dim strNumber As String = "123" Dim intValue As Integer If Integer.TryParse(strNumber, intValue) Then ' Conversion successful, intValue now holds the parsed value Else ' Conversion failed, handle the error End If Option A, Convert , is a general-purpose class that provides various methods for converting between data types. While it can be used for converting strings to numbers, it's not the primary method used when error handling is a concern. Option C, Extern , is not a method for converting strings to numbers in Visual Basic . Option D, Parse , is a method for converting strings to numbers, but it does not handle errors in the same way as TryParse . Therefore, the correct option is Option B: TryParse .
💡Key Conceptual Anchor:Visual Basic
Question 8 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
String comparison in Visual basic is case-sensitive.
Correct Answer: Option A — True
Detailed Academic Explanation:
In Visual Basic , string comparison is case-sensitive . This means that when you compare two strings, the comparison takes into account the exact letter case of each character in the strings. For example, if you have the strings "Hello" and "hello", a case-sensitive comparison would consider these strings to be different. To perform a case-insensitive string comparison, you would need to use appropriate methods or functions, such as String.Compare with the appropriate StringComparison enumeration value (e.g., StringComparison.OrdinalIgnoreCase ). Therefore, the correct option is Option A: True .
💡Key Conceptual Anchor:Visual Basic
Question 9 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
. . . . . . . . is the default Visual Basic data type
Correct Answer: Option C — variant
Detailed Academic Explanation:
In Visual Basic , the default data type is variant . A variant is a data type that can hold any type of data. It's a flexible data type that can store numbers, strings, dates, and other types of values. However, while it provides flexibility, it can also lead to some performance overhead and potential type-related issues. Option A, string , is not the default data type in Visual Basic , although strings are commonly used data types. Option B, boolean , is not the default data type in Visual Basic . A boolean data type can only hold True or False values. Option D, date , is not the default data type in Visual Basic . While date is a common data type, variant is the default. Therefore, the correct option is Option C: variant .
💡Key Conceptual Anchor:Visual Basic
Question 10 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following displays the list of projects contained in the Visual Basic current solution?
Correct Answer: Option D — Solution Explorer Window
Detailed Academic Explanation:
In Visual Basic , the Solution Explorer Window displays the list of projects contained in the current solution. The solution is a container that holds one or more projects, and the Solution Explorer provides a hierarchical view of these projects along with their files and resources. The Solution Explorer helps you manage your projects, files, references, and other related resources. You can add or remove projects, organize files, and perform various project-related tasks using this window. Option A, List Window , is not a standard term in Visual Basic and does not refer to the window that displays the list of projects. Option B, Project Window , does not typically refer to the window that displays the list of projects in the solution. It might be confused with the Solution Explorer, which serves this purpose. Option C, Catalogue Window , is not a standard term in Visual Basic and does not refer to the window that displays the list of projects. Therefore, the correct option is Option D: Solution Explorer Window .
💡Key Conceptual Anchor:Visual Basic
Question 11 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What will contain in txtFirst after the following Visual Basic code is executed? strName = "Penny Swanson" txtFirst.Text = strName.Remove(5)
Correct Answer: Option A — Penny
Detailed Academic Explanation:
The Remove method in Visual Basic removes a specified number of characters from a string starting from the beginning. In this code snippet, strName is assigned the value "Penny Swanson". Then, the Remove method is used to remove characters from the beginning of strName . In the expression strName.Remove(5) , it removes characters starting from index 0 up to (but not including) index 5. So, it removes the characters " Swans" from "Penny Swanson", leaving "Penny". Therefore, after execution, txtFirst.Text will contain " Penny ".
💡Key Conceptual Anchor:Visual Basic
Question 12 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In the following Visual Basic code, what will be in msg, if str contains "visual basic"? Dim str as String Dim msg as String If str.toUpper="VISUAL BASIC" msg="VB.Net" Else msg="Not Visual Basic" EndIf
Correct Answer: Option A — VB.Net
Detailed Academic Explanation:
The given Visual Basic code snippet compares the string variable str with "VISUAL BASIC" after converting it to uppercase using the ToUpper method. If the str variable contains "visual basic", it will be converted to "VISUAL BASIC" and compared with "VISUAL BASIC". Since the comparison is case insensitive due to the use of ToUpper, the condition will be true and msg will be assigned the value "VB.Net". Hence, the output will be "VB.Net".
💡Key Conceptual Anchor:Visual Basic
Question 13 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What output will be returned if the following Visual Basic code is executed? strVisualBasic = "Example, VB.Net" intCharIndex = strVisualBasic.IndexOf("VB")
Correct Answer: Option B — 9
Detailed Academic Explanation:
The IndexOf function in Visual Basic is used to find the first occurrence of a specific string within another string. In this code, strVisualBasic is assigned the string "Example, VB.Net". The line intCharIndex = strVisualBasic.IndexOf("VB") attempts to find the starting position of the substring "VB" within strVisualBasic. The IndexOf function returns the index (position) of the first character of the found substring. The index starts at 0. In the string "Example, VB.Net", "VB" starts at the 9th position (remember counting starts at 0). 'E' is at index 0, 'x' is at index 1, 'a' is at index 2, 'm' is at index 3, 'p' is at index 4, 'l' is at index 5, 'e' is at index 6, ',' is at index 7, ' ' is at index 8, 'V' is at index 9. Therefore, intCharIndex will be assigned the value 9. So the correct answer is Option B: 9
💡Key Conceptual Anchor:Visual Basic
Question 14 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following returns a value after performing its specific task in Visual Basic?
Correct Answer: Option D — Function Procedure
Detailed Academic Explanation:
Function Procedure is the correct answer to “Which of the following returns a value after performing its specific task in Visual Basic”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 15 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
All Code in Visual Basic is stored in the form of. . . . . . . .
Correct Answer: Option B — module
Detailed Academic Explanation:
module is the correct answer to “All Code in Visual Basic is stored in the form of. . . . . . . .”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 16 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The . . . . . . . . is a very useful control for Visual Basic, as it is not only used to provide instructions and guides to the users, it can also be used to display outputs.
Correct Answer: Option C — label
Detailed Academic Explanation:
label is the correct answer to “The . . . . . . . . is a very useful control for Visual Basic, as it is not only used to provide instructions and guides to the users, it can also be used to display outputs.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 17 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
when we Declaring a variable before programming start it is called as . . . . . . . . it tells Visual Basic to reserve space in memory.
Correct Answer: Option A — explicit declaring
Detailed Academic Explanation:
explicit declaring is the correct answer to “when we Declaring a variable before programming start it is called as . . . . . . . . it tells Visual Basic to reserve space in memory.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 18 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What happens when both the minimize box and maximize box property are set to false in Visual Basic?
Correct Answer: Option A — Both are removed from the title bar
Detailed Academic Explanation:
Both are removed from the title bar is the correct answer to “What happens when both the minimize box and maximize box property are set to false in Visual Basic”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 19 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In Visual Basic, which of the following keyword tells the computer to pass the variable's address rather than its contents?
Correct Answer: Option C — ByRef
Detailed Academic Explanation:
ByRef is the correct answer to “In Visual Basic, which of the following keyword tells the computer to pass the variable's address rather than its contents”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 20 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
In Visual Basic if we declare a variable without any data type by . . . . . . . .this the data type is assigned as default..
Correct Answer: Option C — variant
Detailed Academic Explanation:
variant is the correct answer to “In Visual Basic if we declare a variable without any data type by . . . . . . . .this the data type is assigned as default..”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 21 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following method is used to sort an array in visual basic?
Correct Answer: Option A — Array.Sort()
Detailed Academic Explanation:
Array.Sort() is the correct answer to “Which of the following method is used to sort an array in visual basic”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 22 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following instruction tells the computer to close the current form in Visual Basic?
Correct Answer: Option B — Me.Close()
Detailed Academic Explanation:
Me.Close() is the correct answer to “Which of the following instruction tells the computer to close the current form in Visual Basic”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 23 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is used to write a stream of characters in Visual Basic?
Correct Answer: Option C — StreamWriter object
Detailed Academic Explanation:
StreamWriter object is the correct answer to “Which of the following is used to write a stream of characters in Visual Basic”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 24 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is the default name assigned to the label control in Visual Basic?
Correct Answer: Option A — Label1
Detailed Academic Explanation:
Label1 is the correct answer to “Which of the following is the default name assigned to the label control in Visual Basic”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 25 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
You can eliminate the problems of implicit type conversion, with the help of . . . . . . . .
Correct Answer: Option A — Option Strict On
Detailed Academic Explanation:
Option Strict On is the correct answer to “You can eliminate the problems of implicit type conversion, with the help of . . . . . . . .”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 26 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The . . . . . . . . constant instructs the computer to advance the insertion point to the next line in control.
Correct Answer: Option A — ControlChars.NewLine
Detailed Academic Explanation:
ControlChars.NewLine is the correct answer to “The . . . . . . . . constant instructs the computer to advance the insertion point to the next line in control.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 27 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The . . . . . . . . operator is commonly used to determine whether a number is even or odd.
Correct Answer: Option B — Modulus
Detailed Academic Explanation:
Modulus is the correct answer to “The . . . . . . . . operator is commonly used to determine whether a number is even or odd.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 28 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
. . . . . . . . operator reverses the truth value of the operation.
Correct Answer: Option C — NOT
Detailed Academic Explanation:
NOT is the correct answer to “. . . . . . . . operator reverses the truth value of the operation.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 29 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A variable is scoped to a global or local variable depending on how it is declared.
Correct Answer: Option A — TRUE
Detailed Academic Explanation:
TRUE is the correct answer to “A variable is scoped to a global or local variable depending on how it is declared.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 30 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A procedure-level variable is declared using . . . . . . . . keyword.
Correct Answer: Option C — Dim
Detailed Academic Explanation:
Dim is the correct answer to “A procedure-level variable is declared using . . . . . . . . keyword.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 31 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
when we declare the variable in . . . . . . . . of VB then it is public variable
Correct Answer: Option B — public
Detailed Academic Explanation:
public is the correct answer to “when we declare the variable in . . . . . . . . of VB then it is public variable”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 32 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The position of an item in a list box depends on the value stored in the list box's . . . . . . . .
Correct Answer: Option C — Sorted property
Detailed Academic Explanation:
Sorted property is the correct answer to “The position of an item in a list box depends on the value stored in the list box's . . . . . . . .”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 33 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The . . . . . . . . validator is used to compare an entry with a constant value or the property stored in a control.
Correct Answer: Option A — CompareValidator
Detailed Academic Explanation:
CompareValidator is the correct answer to “The . . . . . . . . validator is used to compare an entry with a constant value or the property stored in a control.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 34 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The . . . . . . . . in a pattern represents one character only.
Correct Answer: Option A — ?
Detailed Academic Explanation:
? is the correct answer to “The . . . . . . . . in a pattern represents one character only.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 35 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which is used to check both the conditions in a given if statement?
Correct Answer: Option B — AndAlso
Detailed Academic Explanation:
AndAlso is the correct answer to “Which is used to check both the conditions in a given if statement”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 36 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A label control's . . . . . . . . property determines whether the control automatically sizes to fit its current contents.
Correct Answer: Option A — AutoSize property
Detailed Academic Explanation:
AutoSize property is the correct answer to “A label control's . . . . . . . . property determines whether the control automatically sizes to fit its current contents.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 37 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
When the . . . . . . . . is checked, its value is set to 1 and when it is unchecked, the value is set to 0.
Correct Answer: Option B — checkbox
Detailed Academic Explanation:
checkbox is the correct answer to “When the . . . . . . . . is checked, its value is set to 1 and when it is unchecked, the value is set to 0.”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 38 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which event occurs each time an interval is elapsed in the timer?
Correct Answer: Option A — Tick
Detailed Academic Explanation:
Tick is the correct answer to “Which event occurs each time an interval is elapsed in the timer”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 39 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Selection structures that can select from many alternatives are known as . . . . . . . .
Correct Answer: Option B — Multiple-alternative selection structures
Detailed Academic Explanation:
Multiple-alternative selection structures is the correct answer to “Selection structures that can select from many alternatives are known as . . . . . . . .”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
Question 40 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
StretchImage Property is present in which dialog box?
Correct Answer: Option A — Task list
Detailed Academic Explanation:
Task list is the correct answer to “StretchImage Property is present in which dialog box”. This question is standard in competitive examination syllabi for Visual Basic.
💡Key Conceptual Anchor:Visual Basic
✓Link copied to clipboard
Continue Your Practice
Advanced Mapreduce Concepts — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.