Visual Programming MCQs with Answers
Practice important Visual Programming MCQs with answers and explanations.
Multiple Choice Questions
Q121: How do you write a Hello World program in C# that outputs to the console?
- A: System.print("Hello world!");
- B: System.out("Hello world!");
- C: Console.writeline("Hello world!");
- D: Console.output("Hello world!");
View Answer
C
Q122: What method is used to write to the console and get input from the user in C#?
- A: Console.input()
- B: Console.scanf()
- C: Console.read()
- D: Console.readline()
View Answer
D
Q123: Which of the following is used to compile a C# program into an executable?
- A: Java Runtime Environment
- B: .NET Framework
- C: Common Language Infrastructure
- D: C++ Runtime
View Answer
C
Q124: What is a feature of C# regarding exceptions?
- A: Supports checked exceptions
- B: Does not support checked exceptions
- C: Requires manual exception handling
- D: Does not allow exceptions
View Answer
B
Q125: What does the following code snippet demonstrate? Genericlist<int> list1 = new genericlist<int>();
- A: Generics
- B: Boxing
- C: Polymorphism
- D: Inheritance
View Answer
A
Q126: How are functions written in C#?
- A: def functionName()
- B: function functionName()
- C: public static void functionName()
- D: void functionName()
View Answer
C
Q127: What does the Main() function represent in a C# program?
- A: The start point of the program
- B: The end point of the program
- C: A helper function
- D: An error handler
View Answer
A
Q128: What type does the Bool keyword represent in C#?
- A: Integer
- B: Boolean
- C: String
- D: Float
View Answer
B
Q129: Which of the following is an integer type in C#?
- A: float
- B: double
- C: int
- D: string
View Answer
C
Q130: What does the System.String type support in C#?
- A: Boolean values
- B: Escape and verbatim sequences
- C: Integer arithmetic
- D: Floating-point arithmetic
View Answer
B