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 : C

Explanation

Both of the above options are correct.

Q 3 - Which of the following converts a type to a double type in C#?

A - ToDecimal

B - ToDouble

C - ToInt16

D - ToInt32

Answer : B

Explanation

ToDouble() method converts a type to a double type.

Q 4 - Which of the following operator creates a pointer to a variable in C#?

A - sizeof

B - typeof

C - &

D - *

Answer : D

Explanation

* operator creates a pointer to a variable.

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.

Q 7 - Which of the following is the default access specifier of a class member function?

A - Private

B - Public

C - Protected

D - Internal

Answer : A

Explanation

Default access for the class member function is Private.

Q 8 - The comparison operators can be overloaded.

A - true

B - false

Answer : A

Explanation

The comparison operators can be overloaded.

Q 9 - Which of the following preprocessor directive specifies the end of a conditional directive in C#?

A - elif

B - endif

C - if

D - else

Answer : B

Explanation

#endif − Specifies the end of a conditional directive.

Answer : C

Explanation

Both of the above options are correct.

csharp_questions_answers.htm
Advertisements