Miscellaneous In C Sharp — Part 1 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Miscellaneous In C Sharp — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
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
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the "using" keyword in C#?
Correct Answer: Option C — To import external libraries
Detailed Academic Explanation:
To import external libraries is the correct answer to “What is the purpose of the "using" keyword in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "break" keyword do in a switch statement?
Correct Answer: Option A — Exits the switch statement
Detailed Academic Explanation:
Exits the switch statement is the correct answer to “What does the "break" keyword do in a switch statement”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is NOT a valid C# access modifier?
Correct Answer: Option C — protected
Detailed Academic Explanation:
protected is the correct answer to “Which of the following is NOT a valid C# access modifier”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "this" keyword refer to in C#?
Correct Answer: Option D — The current class instance
Detailed Academic Explanation:
The current class instance is the correct answer to “What does the "this" keyword refer to in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the "async" and "await" keywords in C#?
Correct Answer: Option C — To perform asynchronous operations
Detailed Academic Explanation:
To perform asynchronous operations is the correct answer to “What is the purpose of the "async" and "await" keywords in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "params" keyword allow in C#?
Correct Answer: Option C — Passing array of arguments
Detailed Academic Explanation:
Passing array of arguments is the correct answer to “What does the "params" keyword allow in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "is" keyword do in C#?
Correct Answer: Option B — Checks if an object is of a certain type
Detailed Academic Explanation:
Checks if an object is of a certain type is the correct answer to “What does the "is" keyword do in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "typeof" operator return in C#?
Correct Answer: Option C — The type of a specified object
Detailed Academic Explanation:
The type of a specified object is the correct answer to “What does the "typeof" operator return in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the default value of an integer variable in C# if it is not explicitly initialized?
Correct Answer: Option D — 0
Detailed Academic Explanation:
0 is the correct answer to “What is the default value of an integer variable in C# if it is not explicitly initialized”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the "as" keyword in C#?
Correct Answer: Option A — To perform type casting
Detailed Academic Explanation:
To perform type casting is the correct answer to “What is the purpose of the "as" keyword in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is NOT a valid C# loop construct?
Correct Answer: Option B — repeat-until
Detailed Academic Explanation:
repeat-until is the correct answer to “Which of the following is NOT a valid C# loop construct”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "sealed" keyword do in C#?
Correct Answer: Option D — Prevents a class from being inherited
Detailed Academic Explanation:
Prevents a class from being inherited is the correct answer to “What does the "sealed" keyword do in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C#, what does the "using" directive do?
Correct Answer: Option C — Imports namespaces
Detailed Academic Explanation:
Imports namespaces is the correct answer to “In C#, what does the "using" directive do”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "ref" keyword allow in C#?
Correct Answer: Option B — Passing parameters by reference
Detailed Academic Explanation:
Passing parameters by reference is the correct answer to “What does the "ref" keyword allow in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "using" keyword do in the context of IDisposable objects in C#?
Correct Answer: Option D — Automatically disposes resources
Detailed Academic Explanation:
Automatically disposes resources is the correct answer to “What does the "using" keyword do in the context of IDisposable objects in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the "base" keyword in C#?
Correct Answer: Option A — Calls a method in the base class
Detailed Academic Explanation:
Calls a method in the base class is the correct answer to “What is the purpose of the "base" keyword in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following statements about properties in C# is true?
Correct Answer: Option D — Properties encapsulate fields
Detailed Academic Explanation:
Properties encapsulate fields is the correct answer to “Which of the following statements about properties in C# is true”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following statements about constructors in C# is true?
Correct Answer: Option B — Constructors are called when an object is created
Detailed Academic Explanation:
Constructors are called when an object is created is the correct answer to “Which of the following statements about constructors in C# is true”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "abstract" keyword indicate in C#?
Correct Answer: Option C — Marks a class as incomplete
Detailed Academic Explanation:
Marks a class as incomplete is the correct answer to “What does the "abstract" keyword indicate in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the "delegate" keyword in C#?
Correct Answer: Option D — Defines a reference type for methods
Detailed Academic Explanation:
Defines a reference type for methods is the correct answer to “What is the purpose of the "delegate" keyword in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the default value of a boolean variable in C# if it is not explicitly initialized?
Correct Answer: Option A — FALSE
Detailed Academic Explanation:
FALSE is the correct answer to “What is the default value of a boolean variable in C# if it is not explicitly initialized”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "out" keyword allow in C# method parameters?
Correct Answer: Option D — Returning multiple values
Detailed Academic Explanation:
Returning multiple values is the correct answer to “What does the "out" keyword allow in C# method parameters”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "var" keyword do in C#?
Correct Answer: Option B — Specifies an implicitly typed variable
Detailed Academic Explanation:
Specifies an implicitly typed variable is the correct answer to “What does the "var" keyword do in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is NOT a valid type conversion in C#?
Correct Answer: Option C — string to int
Detailed Academic Explanation:
string to int is the correct answer to “Which of the following is NOT a valid type conversion in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "out" keyword do in C# method parameters?
Correct Answer: Option D — To indicate an output parameter
Detailed Academic Explanation:
To indicate an output parameter is the correct answer to “What does the "out" keyword do in C# method parameters”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "async" and "await" keywords do in C#?
Correct Answer: Option A — To perform asynchronous operations
Detailed Academic Explanation:
To perform asynchronous operations is the correct answer to “What does the "async" and "await" keywords do in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the "as" keyword do in C#?
Correct Answer: Option C — Performs type casting
Detailed Academic Explanation:
Performs type casting is the correct answer to “What does the "as" keyword do in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the "typeof" operator in C#?
Correct Answer: Option C — Returns the type of a specified object
Detailed Academic Explanation:
Returns the type of a specified object is the correct answer to “What is the purpose of the "typeof" operator in C#”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code snippet? public class A { public int x; public int y; public void display() { Console.WriteLine(x + " " + y); } } class Program { static void Main(string[] args) { A obj1 = new A(); A obj2 = new A(); obj1.x = 1; obj1.y = 2; obj2 = obj1; obj1.display(); obj2.display(); } }
Correct Answer: Option B — 1 2 1 2
Detailed Academic Explanation:
1 2 1 2 is the correct answer to “What will be the output of the following C# code snippet? public class A { public int x; public int y; public void display() { Console.WriteLine(x + " " + y); } } class Program { static void Main(string[] args) { A obj1 = new A(); A obj2 = new A(); obj1.x = 1; obj1.y = 2; obj2 = obj1; obj1.display(); obj2.display(); } }”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which method is called when a thread is blocked from running temporarily?
Correct Answer: Option C — Wait()
Detailed Academic Explanation:
Wait() is the correct answer to “Which method is called when a thread is blocked from running temporarily”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
public, private, protected, internal, protected internal is the correct answer to “Accessibility modifiers defined in a class are”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is mutex?
Correct Answer: Option A — a mutually exclusive synchronization object
Detailed Academic Explanation:
a mutually exclusive synchronization object is the correct answer to “What is mutex”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these constructors is used to create an empty String object?
Correct Answer: Option A — String()
Detailed Academic Explanation:
String() is the correct answer to “Which of these constructors is used to create an empty String object”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which among the following is a .NET namespace?
Correct Answer: Option A — System.Web
Detailed Academic Explanation:
System.Web is the correct answer to “Which among the following is a .NET namespace”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code snippet? class Program { static void Main(string[] args) { String c = "Hello i love Csharp"; Boolean var; var = c.StartsWith("hello"); Console.WriteLine(var); Console.ReadLine(); } }
Correct Answer: Option B — False
Detailed Academic Explanation:
False is the correct answer to “What will be the output of the following C# code snippet? class Program { static void Main(string[] args) { String c = "Hello i love Csharp"; Boolean var; var = c.StartsWith("hello"); Console.WriteLine(var); Console.ReadLine(); } }”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the following C# code snippet specify? class MyClass { char chrs = 'A' ; public IEnumerator GetEnumerator() { for (int i = 20; i >=0; --i) if (i == 10) yield break; yield return (char)((chrs + i)); } } class Program { static void Main(string[] args) { MyClass mc = new MyClass(); foreach (char ch in mc) Console.Write(ch + " "); Console.WriteLine(); Console.ReadLine(); } }
Correct Answer: Option C — U T S R Q P O N M L
Detailed Academic Explanation:
U T S R Q P O N M L is the correct answer to “What will be the following C# code snippet specify? class MyClass { char chrs = 'A' ; public IEnumerator GetEnumerator() { for (int i = 20; i >=0; --i) if (i == 10) yield break; yield return (char)((chrs + i)); } } class Program { static void Main(string[] args) { MyClass mc = new MyClass(); foreach (char ch in mc) Console.Write(ch + " "); Console.WriteLine(); Console.ReadLine(); } }”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code snippet? class Program { static void Main(string[] args) { String s1 = "one"; String s2 = string.Concat(s1 + " " + "two"); Console.WriteLine(s2); Console.ReadLine(); } }
Correct Answer: Option C — one two
Detailed Academic Explanation:
one two is the correct answer to “What will be the output of the following C# code snippet? class Program { static void Main(string[] args) { String s1 = "one"; String s2 = string.Concat(s1 + " " + "two"); Console.WriteLine(s2); Console.ReadLine(); } }”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code snippet? class UnsafeCode { unsafe static void Main() { int* ptrs = stackalloc int[3]; ptrs[0] = 1; ptrs[1] = 2; ptrs[2] = 3; for (int i = 2; i >= 0; --i) { ptrs[i] = ptrs[i]* 3; ptrs[i] = ptrs[i] + 4; Console.WriteLine(ptrs[i]); } Console.ReadLine(); } }
Correct Answer: Option B — 13, 10, 7
Detailed Academic Explanation:
13, 10, 7 is the correct answer to “What will be the output of the following C# code snippet? class UnsafeCode { unsafe static void Main() { int* ptrs = stackalloc int[3]; ptrs[0] = 1; ptrs[1] = 2; ptrs[2] = 3; for (int i = 2; i >= 0; --i) { ptrs[i] = ptrs[i]* 3; ptrs[i] = ptrs[i] + 4; Console.WriteLine(ptrs[i]); } Console.ReadLine(); } }”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Choose the base class for string() method.
Correct Answer: Option C — System.String
Detailed Academic Explanation:
System.String is the correct answer to “Choose the base class for string() method.”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the yield return statement specify in the following C# code snippet? public System.Collections.IEnumerator GetEnumerator() { foreach (char ch in chrs) yield return ch; }
Correct Answer: Option B — returns the next object in the collection
Detailed Academic Explanation:
returns the next object in the collection is the correct answer to “What does the yield return statement specify in the following C# code snippet? public System.Collections.IEnumerator GetEnumerator() { foreach (char ch in chrs) yield return ch; }”. This question is standard in competitive examination syllabi for Miscellaneous In C Sharp.
💡Key Conceptual Anchor:Miscellaneous In C Sharp
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
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.