C# Online Quiz


Advertisements


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 2 - Which of the following converts a type to a Boolean value, where possible in C#?

A - ToBoolean

B - ToSingle

C - ToChar

D - ToDateTime

Answer : A

Explanation

ToBoolean() method converts a type to a Boolean value, 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 method copies the actual value of an argument into the formal parameter of the function?

A - Value parameters

B - Reference parameters

C - Output parameters

D - None of the above.

Answer : A

Explanation

Value parameters method copies the actual value of an argument into the formal parameter of the function.

Q 6 - Which of the following property of Array class in C# gets a 32-bit integer, the total number of elements in all the dimensions of the Array?

A - Rank

B - LongLength

C - Length

D - None of the above.

Answer : C

Explanation

Length gets a 32-bit integer that represents the total number of elements in all the dimensions of the Array.

Answer : D

Explanation

All of the above options are correct.

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 allows you to undefine a symbol in C#?

A - define

B - undef

C - region

D - endregion

Answer : B

Explanation

#undef: It allows you to undefine a symbol.

Answer : C

Explanation

Both of the above options are correct.


csharp_questions_answers.htm

Advertisements