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

Explanation

Both of the above options are correct.

Q 2 - Which of the following converts a type to a single Unicode character, where possible in C#?

A - ToSingle

B - ToByte

C - ToChar

D - ToDateTime

Answer : C

Explanation

ToChar() method converts a type to a single Unicode character, where possible.

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

A - ToType

B - ToSbyte

C - ToSingle

D - ToString

Answer : A

Explanation

ToType() method converts a type to a specified type.

Q 4 - Which of the following operator returns the type of a class in C#?

A - sizeof

B - typeof

C - &</a>

D - *

Answer : B

Explanation

typeof() operator returns the type of a class.

Q 5 - Which of the following access specifier in C# allows a class to expose its member variables and member functions to other functions and objects in the current assembly?

A - Public

B - Private

C - Protected

D - Internal

Answer : D

Explanation

Internal access specifier allows a class to expose its member variables and member functions to other functions and objects in the current assembly.

Q 6 - Which of the following property of Array class in C# gets the rank (number of dimensions) of the Array?

A - Rank

B - LongLength

C - Length

D - None of the above.

Answer : A

Explanation

Rank gets the rank (number of dimensions) of the Array.

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 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.

Answer : C

Explanation

Both of the above options are correct.

csharp_questions_answers.htm
Advertisements