C# Online Quiz


Following quiz provides Multiple Choice Questions (MCQs) related to C#. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - We can use reserved keywords as identifiers in C#?

A - true

B - false

Answer : B

Explanation

Keywords are reserved words predefined to the C# compiler. These keywords cannot be used as identifiers.

Answer : D

Explanation

All of the above options are correct.

Q 3 - Which of the following converts a type to a 16-bit integer in C#?

A - ToDecimal

B - ToDouble

C - ToInt16

D - ToInt32

Answer : C

Explanation

ToInt16() method converts a type to a 16-bit integer.

Q 4 - Which of the following operator represents a conditional operation in C#?

A - ?:

B - is

C - as

D - *

Answer : A

Explanation

?: operator represents a conditional operation.

Q 5 - Which of the following access specifier in C# allows a child class to access the member variables and member functions of its base class?

A - Public

B - Private

C - Protected

D - Internal

Answer : C

Explanation

Protected access specifier allows a child class to access the member variables and member functions of its base class.

Answer : D

Explanation

All of the above options are correct.

Q 9 - Which of the following preprocessor directive defines a sequence of characters as symbol in C#?

A - define

B - undef

C - region

D - endregion

Answer : A

Explanation

#define: It defines a sequence of characters, called symbol.

csharp_questions_answers.htm
Advertisements