C# Multiple Choice Questions

Following quiz provides Multiple Choice Questions (MCQs) related to C#. 

csharp-image.png

You can check all the questions and given choice, and select one answer in your answersheet, once you have selected answer, you can click on "View Answer" to check if you are correct or not.

 


sizeof

typeof

&

Explanation:
& operator returns the address of an variable.

*

View answer

&

Explanation:
& operator returns the address of an variable.


0, 0, 0 4, 4, 4 8, 8, 8

Explanation: Since, with each value of of ‘i’ the value of ‘j’ is executed three times i.e
for i = 0, j = 0, 0, 0, i = 1, j = 2, 2, 2.

4, 4, 4  8, 8, 8   12, 12, 12

8, 8, 8  12, 12, 12  16, 16, 16

0, 0, 0  1, 1, 1  2, 2, 2

View answer

0, 0, 0 4, 4, 4 8, 8, 8

Explanation: Since, with each value of of ‘i’ the value of ‘j’ is executed three times i.e
for i = 0, j = 0, 0, 0, i = 1, j = 2, 2, 2.


Encapsulation is defined as the process of enclosing one or more items within a physical or logical package.

Encapsulation, in object oriented programming methodology, prevents access to implementation details.

Abstraction allows making relevant information visible and encapsulation enables a programmer to implement the desired level of abstraction.

All Of above

View answer

All Of above


web.config

global.asax

webapplication.vsdisco

assemblyinfo.cs

View answer

web.config


nestedif statement

#endif statement

switch case statement

None of the above

View answer

switch case statement



Each property consists of accessor as get and set

A property cannot be either read or write only

Properties can be used to store and retrieve values to and from the data members of a class

Properties are like actual methods which work like data members

View answer

Each property consists of accessor as get and set


StackOverflow

Division By Zero

Insufficient Memory

Incorrect Arithmetic Expression

View answer

Incorrect Arithmetic Expression



Occurs during Just-In-Time compilation.

Occurs at run-time.

Occurs during compilation.

Occurs during compilation.

View answer

Occurs at run-time.


Unmanaged Code

Managed Code

The Common Language Runtime (CLR) is an environment that manages code execution and provides application development services. Compilers such as VB.NET expose CLR features to allow developers to create applications. Code created in this environment is called managed code.

PIN Code

COM Code

View answer

Managed Code

The Common Language Runtime (CLR) is an environment that manages code execution and provides application development services. Compilers such as VB.NET expose CLR features to allow developers to create applications. Code created in this environment is called managed code.


copy()

concat()

Compare()

C# Compare() method is used to compare first string with second string lexicographically. It returns an integer value. If both strings are equal, it returns 0.

compareto()

View answer

Compare()

C# Compare() method is used to compare first string with second string lexicographically. It returns an integer value. If both strings are equal, it returns 0.


System.Object

System.Parent

System.Base

System.Root

View answer

System.Object


Role-based security and Authentication Security

Role-based security and Code access security

Code access security and Authentication Security

Cookie-based Authentication and PIN Security

View answer

Role-based security and Authentication Security




That's it, we are done with Multiple choice Interview questions for C#, we may add more questions later.

You may also like to read:

SQL Multiple Choice Questions and answers

Javascript Multiple Choice questions and answers

OOPS interview questions in C# (With Answers)

ASP.NET Core Interview questions and answers

ASP.NET MVC Interview Questions and Answers