150+ C# MCQ
150+ C# MCQ
Sr.No
Project Name YouTube Link
11 Tour and Travel System Project version 3.0 https://youtu.be/Dm7nOdpasWg?si=P_Lh2gcOFhlyudug
12 Gym Management system Project https://youtu.be/J8_7Zrkg7ag?si=LcxV51ynfUB7OptX
13 Online Driving License system Project https://youtu.be/3yRzsMs8TLE?si=JRI_z4FDx4Gmt7fn
14 Online Flight Booking system Project https://youtu.be/m755rOwdk8U?si=HURvAY2VnizIyJlh
15 Employee management system project https://youtu.be/lD1iE3W_GRw?si=Y_jv1xV_BljhrD0H
16 Online student school or college portal https://youtu.be/4A25aEKfei0?si=RoVgZtxMk9TPdQvD
17 Online movie booking system project https://youtu.be/Lfjv_U74SC4?si=fiDvrhhrjb4KSlSm
18 Online Pizza Delivery system project https://youtu.be/Tp3izreZ458?si=8eWAOzA8SVdNwlyM
19 Online Crime Reporting system Project https://youtu.be/0UlzReSk9tQ?si=6vN0e70TVY1GOwPO
20 Online Children Adoption Project https://youtu.be/3T5HC2HKyT4?si=bntP78niYH802I7N
pg. 4 contact us on 8007592194 / 9284926333 www.codewitharrays.in
Chapter: Unit 1
1. Which of the following statements are TRUE about the .NET CLR?
1. It provides a language-neutral development & execution environment.
2. It ensures that an application would not be able to access memory that it is not authorized to access.
3. It provides services to run "managed" applications.
4. The resources are garbage collected.
5. It provides services to run "unmanaged" applications.
A. Only 1 and 2
C. 1,2,3,4
D. Only 4 and 5
Answer» C. 1,2,3,4
discuss
2. Which of the following are valid .NET CLR JIT performance counters?
1. Total memory used for JIT compilation
2. Average memory used for JIT compilation
3. Number of methods that failed to compile with the standard JIT
4. Percentage of processor time spent performing JIT compilation
5. Percentage of memory currently dedicated for JIT compilation
A. 1,5
B. 3,4
C. 1,2
D. 4,5
Answer» B. 3,4
discuss
D. Managed code is the code that is written to target the services of the CLR.
Answer» D. Managed code is the code that is written to target the services of the CLR.
discuss
4. Which of the following are NOT true about .NET Framework?
1. It provides a consistent object-oriented programming environment whether object code is stored and
executed locally, executed locally but Internet-distributed, or executed remotely.
2. It provides a code-execution environment that minimizes software deployment and versioning conflicts.
3. It provides a code-execution environment that promotes safe execution of code, including code created
by an unknown or semi-trusted third party.
4. It provides different programming models for Windows-based applications and Web-based applications.
5. It provides an event driven programming model for building Windows Device Drivers.
A. 1,2
B. 2,4
C. 4,5
D. 1,2,4
Answer» C. 4,5
discuss
5. Which of the following components of the .NET framework provide an extensible set of classes that can be
used by any .NET compliant programming language?
6. Which of the following .NET components can be used to remove unused references from the managed
heap?
B. CLR
C. Garbage Collector
D. Class Loader
It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web
A.
Services
B. It is an environment for developing, building, deploying and executing only Web Applications.
Answer» A. It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and
Web Services
7. Which of the following statements correctly define .NET Framework?
Answer» A. It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and
Web Services
discuss
A. 1,2
B. 2,3
C. 3,4
D. 2,5
Answer» B. 2,3
discuss
A. Private Assemblies
B. Friend Assemblies
C. Shared Assemblies
D. Public Assemblies
A. Unmanaged
B. Distributed
C. Legacy
D. Managed code
C. NET Framework uses DCOM for making transition between managed and unmanaged code.
Answer» C. NET Framework uses DCOM for making transition between managed and unmanaged code.
discuss
12. Which of the following benefits do we get on running managed code under CLR?
1. Type safety of the code running under CLR is assured.
2. It is ensured that an application would not access the memory that it is not authorized to access.
3. It launches separate process for every application running under it.
4. The resources are Garbage collected.
A. Only 1 and 2
B. Only 2, 3 and 4
C. Only 1, 3 and 4
13. Which of the following jobs are done by Common Language Runtime?
1. It provides core services such as memory management, thread management, and remoting.
2. It enforces strict type safety.
3. It provides Code Access Security.
4. It provides Garbage Collection Services.
A. Only 1 and 2
B. Only 3 and 4
C. Only 1, 3 and 4
A. 1,2,3
B. 2,4,5
C. 1,3,5
D. 1,2
Answer» D. 1,2
discuss
A. 1, 2, 3
B. 2,4
C. 3,4,5
D. 1,2
Answer» A. 1, 2, 3
discuss
16. Which of the following are parts of the .NET Framework?
1. The Common Language Runtime (CLR)
2. The Framework Class Libraries (FCL)
3. Microsoft Published Web Services
4. Applications deployed on IIS
5. Mobile Applications
A. Only 1, 2, 3
B. Only 1, 2
C. Only 1, 2, 4
D. Only 4,5
Answer» B. Only 1, 2
discuss
A. Function
B. Metadata
C. Method
D. Managed code
Answer» C. Method
discuss
A. Class()
B. Main()
C. Submain()
D. Namespace
Answer» B. Main()
discuss
A. Constant
B. Reference type
C. Variable
D. Object
Answer» C. Variable
discuss
20. _________ are reserved, and cannot be used as identifiers.
A. Keywords
B. literal
C. variables
D. Identifiers
Answer» A. Keywords
discuss
21. Boxing converts a value type on the stack to an ______ on the heap.
A. Bool type
B. Instance type
C. Class type
D. Object type
A. Unary operator
B. Ternary operator
C. Decision operator
D. Functional operator
A. Center-associative
B. Right-associative
Answer» C. Left-associative
23. In C#, all binary operators are ______.
C. Left-associative
D. Top-associative
Answer» C. Left-associative
discuss
24. An _______ is a symbol that tells the computer to perform certain mathematical or logical manipulations.
A. Operator
B. Expression
C. Condition
D. Logic
Answer» A. Operator
discuss
A. goto
B. Label
C. Logical
D. Bitwise
Answer» B. Label
discuss
26. C# has _______ operator, useful for making two way decisions.
A. Looping
B. Functional
C. Exponential
D. Conditional
Answer» D. Conditional
discuss
27. ________causes the loop to continue with the next iteration after skipping any statements in between.
A. Loop
B. Exit
C. Break
D. Continue
Answer» D. Continue
discuss
28. An ____ is a group of contiguous or related data items that share a common name.
A. Operator
B. Integer
C. Exponential
D. Array
Answer» D. Array
discuss
A. Reference
B. Logical
C. Value
D. Arithmetic
Answer» A. Reference
discuss
A. Square
Answer» C. Rectangular
30. Multidimensional arrays are sometimes called _______ Arrays.
B. Triangular
C. Rectangular
D. Cube
Answer» C. Rectangular
discuss
31. Which of the following define the rules for .Net Languages?
A. GAC
B. CLS
C. CTS
D. CLR
Answer» B. CLS
discuss
A. System.CodeDom
B. System
C. System.IO
D. System.Text
Answer» A. System.CodeDom
discuss
D. None of above
A. 1,2,3
Answer» A. 1,2,3
34. Which of the following statements are correct about JIT?
1. JIT compiler compiles instructions into machine code at run time.
2. The code compiler by the JIT compiler runs under CLR.
3. The instructions compiled by JIT compilers are written in native code.
4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.
B. 2,4
C. 3,4
D. 1,2
Answer» A. 1,2,3
discuss
35. Which of the following is the root of the .NET type hierarchy?
A. System.Type
B. System.Base
C. System.Parent
D. System.Object
Answer» D. System.Object
discuss
A. Unmanaged
B. Distributed
C. Managed Code
D. Native Code
It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web
A.
Services.
B. It is an environment for developing, building, deploying and executing only Web Applications.
Answer» A. It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and
Web Services.
discuss
A. 4
B. 2
C. 1
D. 3
Answer» D. 3
discuss
39. Which of the following utilities can be used to compile managed assemblies into processor-specific native
code?
A. gacutil
B. ngen
C. sn
D. ildasm
Answer» B. ngen
discuss
Chapter: Unit 2
40. Which of the following statements are correct about data types?
1. If the integer literal exceeds the range of byte, a compilation error will occur.
2. We cannot implicitly convert non-literal numeric types of larger storage size to byte.
3. Byte cannot be implicitly converted to float.
4. A char can be implicitly converted to only int data type. 5. We can cast the integral character codes.
A. 1,3,5
B. 2,4
C. 3,5
D. 1,2,5
Answer» D. 1,2,5
discuss
A. Char
B. Byte
C. Integer
D. Long
Answer» A. Char
discuss
42. What will be the output of the following code snippet when it is executed?
int x = 1;
float y = 1.1f;
short z = 1;
Console.Write.Line((float) x + y * z - (x += (short) y));
A. 0.1
B. 1.0
C. 1.1
D. 11
Answer» A. 0.1
discuss
A. 8 bytes
B. 4 bytes
C. 10 bytes
A. 2,5
B. 1,5
Answer» B. 1,5
44. Which of the following statements are correct?
1. We can assign values of any type to variables of type object.
2. When a variable of a value type is converted to object, it is said to be unboxed.
3. When a variable of type object is converted to a value type, it is said to be boxed.
4. Boolean variable cannot have a value of null.
5. When a value type is boxed, an entirely new object must be allocated and constructed.
C. 3,4
D. 2,3
Answer» B. 1,5
discuss
45. Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be
modified?
A. float pi = 3.14F;
B. #define pi 3.14F;
46. Which of the following can be used to terminate a while loop and transfer control outside the loop?
1. exit while
2. continue
3. exit statement
4. break
5. goto
A. 1,3
B. 2,4
C. 3,5
D. 4,5
Answer» D. 4,5
discuss
47. Which of the following statements are correct about the C#.NET
code snippet given below?
if (age > 18 && no < 11) a = 25;
1. The condition no < 11 will be evaluated only if age > 18 evaluates to True.
2. The statement a = 25 will get executed if any one condition is True.
3. The condition no < 11 will be evaluated only if age > 18 evaluates to False.
4. The statement a = 25 will get executed if both the conditions are True.
5. && is known as a short circuiting logical operator.
A. 1,3
B. 2,5
C. 1,4,5,
D. 3,4,5
Answer» C. 1,4,5,
discuss
48. Which of the following is the correct output for the C#.NET code snippet given below?
Console.WriteLine(13 / 2 + " " + 13 % 2);
A. 6.5 1
B. 6.5 0
C. 6 0
D. 6 1
Answer» D. 6 1
discuss
A. 1,3,5
B. 2,4
C. 3,5
D. 2,4,5
Answer» A. 1,3,5
discuss
50. Which of the following is the correct way to create an object of the class Sample?
1. Sample s = new Sample();
2. Sample s;
3. Sample s; s = new Sample();
4. s = new Sample();
A. 1,3
B. 2,4
C. 1,2,3
D. 4,5
Answer» A. 1,3
discuss
Chapter: Unit 2
A. If we provide a one-argument constructor then the compiler still provides a zeroargument constructor.
Answer» D. If we do not provide a constructor, then the compiler provides a zero-argument constructor.
discuss
C. An object is destroyed by the garbage collector when only one reference refers to it.
D. We have to specifically run the garbage collector after executing Visual Studio.NET.
A. 1,2,3
B. 3,4
C. 2,4,5
D. 3,5
Answer» A. 1,2,3
discuss
A. 1,2
B. 1,3,5
C. 3,4
D. 1,2,5
Answer» D. 1,2,5
discuss
A. 1,2
B. 3,4
C. 1,2,4
D. 3,5
Answer» A. 1,2
discuss
57. Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "ALL MEN ARE CREATED EQUAL";
String s2; s2 = s1.Substring(12, 3);
Console.WriteLine(s2);
A. ARE
B. CRE
C. CR
D. REA
Answer» B. CRE
discuss
58. If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two
references?
A. s1 is s2
B. s1=s2
C. s1==s2
D. s1.Equals(s2)
Answer» D. s1.Equals(s2)
discuss
C. It occurs at run-time.
60. Which of the following statements are correct about exception handling in C#.NET?
1 If an exception occurs then the program terminates abruptly without getting any chance to recover from
the exception. 2 No matter whether an exception occurs or not, the statements in the finally clause (if
present) will get executed.
3 A program can contain multiple finally clauses.
4 A finally clause is written outside the try block.
5 Finally clause is used to perform cleanup operations like closing the network/database connections.
A. 1 only
B. 2 only
C. 2 and 5 only
D. 3 and 4 only
61. ______ parameters are used to pass results back to the calling method.
A. Input
B. Reference
C. Value
D. Output
Answer» D. Output
discuss
62. The formal-parameter-list is always enclosed in _______.
A. Square
B. Semicolon
C. Parenthesis
D. Colon
Answer» C. Parenthesis
discuss
63. _______ variables are visible only in the block they are declared.
A. System
B. Global
C. Local
D. Console
Answer» C. Local
discuss
A. parameterized
B. parameter-less
C. Class
D. Method
Answer» B. parameter-less
discuss
65. A structure in C# provides a unique way of packing together data of ______ types.
A. Different
B. Same
C. Invoking
D. Calling
Answer» A. Different
discuss
A. Protected
B. Public
Answer» C. Private
66. Struct’s data members are ____________ by default.
C. Private
D. Default
Answer» C. Private
discuss
A. Copy constructor
B. Default constructor
C. Invoking constructor
D. Calling constructor
68. The methods that have the same name, but different parameter lists and different definitions is called______.
A. Method Overloading
B. Method Overriding
C. Method Overwriting
D. Method Overreading
69. The C# provides special methods known as _____ methods to provide access to data members.
A. Loop
B. Functions
C. Methods
D. Accessor
Answer» D. Accessor
discuss
70. Storage location used by computer memory to store data for usage by an application is ?
A. Pointers
B. Constants
C. Variable
Answer» C. Variable
discuss
71. Which of these can be overloaded?
A. Constructors
B. Methods
C. Both a & b
A. 1
B. 2
C. Any number
C. both a & b
A. int
B. float
C. void
A. delete
B. class
C. constructor
D. None of mentioned
Answer» C. constructor
discuss
80. Which of the following statements are correct about an ArrayList collection that
implements the IEnumerable interface?
1. The ArrayList class contains an inner class that implements the IEnumerator interface.
2. An ArrayList Collection cannot be accessed simultaneously by different threads.
3. The inner class of ArrayList can access ArrayList class's members.
4. To access members of ArrayList from the inner class, it is necessary to pass ArrayList class's reference to
it.
5. Enumerator's of ArrayList Collection can manipulate the array.
A. 1 and 2 only
C. 2 and 5 only
81. How many enumerators will exist if four threads are simultaneously working on an ArrayList object?
A. 1
B. 3
C. 2
D. 4
Answer» D. 4
discuss
82. In which of the following collections is the Input/Output index-based? 1. Stack 2. Queue 3. BitArray 4.
ArrayList 5. HashTable
A. 1 and 2 only
B. 3 and 4 only
C. 5 only
D. 1, 2 and 5 only
A. 1 and 2 only
B. 3 and 4 only
C. 1, 2 and 5 only
84. Which of the following is the correct way to access all elements of the Queue collection created using the
C#.NET code snippet given below? Queue q = new Queue(); q.Enqueue("Sachin"); q.Enqueue('A');
q.Enqueue(false); q.Enqueue(38); q.Enqueue(5.4);
A. 1, 2 and 3 only
B. 1, 3 and 5 only
C. 2 and 4 only
D. 4 only
87. Suppose a Generic class called SortObjects is to be made capable of sorting objects of any type (Integer,
Single, Byte etc.). Which of the following programming constructs should be used to implement the
comparison function?
A. Namespace
B. Interface
C. Encapsulation
D. Delegate
Answer» D. Delegate
discuss
A. Form Designer
B. Code Editor
C. Solution Explorer
A. Checkbox
B. RadioButton
C. ButtonBase
Answer» C. ButtonBase
discuss
92. Which namespace includes most of the Control classes for developing Windows applications?
A. System;
B. System.Windows.Controls
C. System.Windows.Components.Forms
D. System.Windows.Forms
Answer» C. System.Windows.Components.Forms
discuss
93. Which of the Control objects is viewed as a container that can hold other objects when you design a
Windows application?
A. Control
B. Button
C. Window
D. Form
Answer» D. Form
discuss
94. When an instance method declaration includes the abstract modifier, the method is said to be an ______.
A. Abstract method
B. Instance method
C. Sealed method
D. Expression method
95. The theory of _____ implies that user can control the access to a class, method, or variable.
A. Data hiding
B. Encapsulation
C. Information Hiding
D. Polymorphism
Answer» B. Encapsulation
discuss
A. Commutative
B. Associative
C. Transitive
D. Iterative
Answer» C. Transitive
discuss
A. Default point
B. Invoking point
C. Calling point
D. Throw point
A. Method
B. Function
C. Error
Answer» C. Error
98. In C#, having unreachable code is always an _____.
D. Iterative
Answer» C. Error
discuss
99. C# treats the multiple catch statements like cases in a _____________ statement.
A. If
B. Switch
C. For
D. While
Answer» B. Switch
discuss
100. C# supports a technique known as________, which allows a method to specify explicitly the name of the
interface it is implementing.
A. Method Implementation
101. The reason that C# does not support multiple inheritances is because of ______.
A. Method collision
B. Name collision
C. Function collision
D. Interface collision
102. _______ is a set of devices through which a user communicates with a system using interactive set of
commands.
A. Console
B. System
C. Keyboard
D. Monitor
Answer» A. Console
discuss
103. Exponential formatting character (‘E’ or ‘e’) converts a given value to string in the form of _______.
A. m.dddd
B. E+xxx
C. m.dddd
D. E+xxx
Answer» A. m.dddd
discuss
104. The ______ are the Graphical User Interface (GUI) components created for web based interactions..
A. Web forms
B. Window Forms
C. Application Forms
A. JAVA
B. J#
C. VB.NET
D. ASP.NET
Answer» D. ASP.NET
discuss
106. The controls available in the tool box of the ______ are used to create the user interface of a web based
application.
B. Application window
C. Web forms
A. Template, Component
B. CLR, CTS
D. Windows, desktop
108. The ______ parentheses that follow _____ indicate that no information is passed to Main().
A. Empty, class
B. Empty, submain
C. Empty, Main
D. Empty, Namespace
C. compiler, main
110. Which of the following statements is correct about the C#.NET code snippet given below?
class Student s1, s2; // Here 'Student' is a user-defined
class. s1 = new Student();
s2 = new Student();
A. 1, 2, 3
B. 3, 4
C. 2, 4, 5
D. 3, 5
Answer» A. 1, 2, 3
discuss
112. Which of the following should be used to implement a 'Has a' relationship between two entities?
A. Polymorphism
B. Templates
C. Containership
D. Encapsulation
Answer» C. Containership
discuss
113. Which of the following should be used to implement a 'Like a' or a 'Kind of' relationship between two
entities?
A. Polymorphism
B. Containership
C. Templates
D. Inheritance
Answer» D. Inheritance
discuss
115. A class implements two interfaces each containing three methods. The class contains no instance data.
Which of the following correctly indicate the size of the object created from this class?
A. 12 bytes
B. 24 bytes
C. 0 byte
D. 8 bytes
Answer» B. 24 bytes
discuss
116. Which of the following statements is correct about Interfaces used in C#.NET?
117. Which of the following statements is correct about an interface used in C#.NET?
C. A class that implements an interface can explicitly implement members of that interface.
Answer» C. A class that implements an interface can explicitly implement members of that interface.
discuss
Chapter: Unit 4
A. data providers
B. grids
C. columns
D. tables
Answer» D. tables
discuss
120. Each data provider class is grouped and accessible through its:
A. namespace
B. database
C. datagrid
D. provider
Answer» A. namespace
discuss
121. In Visual Studio, the tool that enables you to connect to a database and automatically populate a dataset
object using a TableAdapter object is the ___________wizard:
B. Data Source
C. Query Builder
D. DataSet Designer
A. attributes
B. elements
C. tags
Answer» B. elements
discuss
A. System.Xml;
B. System.Data;
C. System.Xml.Linq;
D. System.Linq;
Answer» C. System.Xml.Linq;
discuss
A. SQL Server
A. a using directive
A. DataAdapter
B. DataReader
C. DataSet
D. CommandBuilder
Answer» A. DataAdapter
discuss
A. Data providers
B. File streams
C. ADO.NET applications
D. Databases
129. A computer application for managing databases and pulling together data to generate reports and make
decisions is known as a(n)
B. It splits data into separate row and column areas called tables.
Answer» B. It splits data into separate row and column areas called tables.
discuss
131. A field is a
A. group of records.
132. Forms and reports, used for entering and editing records, and for generating useful information in reports
are
C. difficult to generate.
133. A computer application that manages a database, in which different kinds of data are stored in separate
tables, is known as a
134. Which of the following are examples of relational database management systems?
A. Foreign key.
B. Primary key.
C. Tertiary key.
D. Secondary key.
A. Many-to-one relationship.
B. Many-to-many relationship.
C. One-to-many relationship.
D. One-to-one relationship.
137. The field in the child table that links information to the parent table is known as the
A. Foreign key.
B. Primary key.
C. Tertiary key.
D. Secondary key.
138. ADO.NET is the data access component of Microsoft’s .NET framework that enables you to
A. connect your Visual Basic.NET applications to your company’s local area network.
A. Multiple users.
B. Single users.
D. Limited users.
140. Which of the following statements characterizes the relationship between a Visual Basic.NET program and
a database record?
A. Duplicate database.
B. Dataset.
C. Table.
D. Database copy.
Answer» B. Dataset.
discuss
C. Consistent format for data across applications, networks, and the Internet.
Answer» C. Consistent format for data across applications, networks, and the Internet.
discuss
146. Why does Visual Studio.NET use XML as a data storage technology?
B. XML restricts the number of applications that can interface with Visual Basic.NET.
A. System.Collections
B. System.Collections.Generic
C. Both a & b
Answer» A. System.Collections
discuss
A. Yes
B. No
C. Situational
Answer» A. Yes
discuss
150. Select the namespace which should be included while making use of LINQ operations:
A. System.Text
B. System.Collections.Generic
C. System.Linq
Answer» C. System.Linq
discuss
https://www.youtube.com/@codewitharrays
https://www.instagram.com/codewitharrays/
https://codewitharrays.in/project