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

Answer : D

Explanation

All of the above options are correct.

Q 2 - Value type variables in C# are derived from the class System.ValueType?

A - true

B - false

Answer : A

Explanation

Value type variables in C# are derived from the class System.ValueType.

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

A - ToInt64

B - ToSbyte

C - ToSingle

D - ToString

Answer : D

Explanation

ToString() method converts a type to a string.

Q 4 - Which of the following operator returns the address of an variable in C#?

A - sizeof

B - typeof

C - &

D - *

Answer : C

Explanation

& operator returns the address of an variable.

Q 8 - The assignment operators cannot be overloaded.

A - true

B - false

Answer : A

Explanation

The assignment operators cannot be overloaded.

Q 9 - Which of the following preprocessor directive allows creating a compound conditional directive in C#?

A - elif

B - define

C - if

D - else

Answer : A

Explanation

#elif − It allows creating a compound conditional directive.

Q 10 - Which of the following preprocessor directive marks the end of a #region block in C#?

A - warning

B - region

C - endregion

D - error

Answer : C

Explanation

#endregion − It marks the end of a #region block.

csharp_questions_answers.htm
Advertisements