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 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 floating point or integer type to a decimal type in C#?

A - ToDecimal

B - ToDouble

C - ToInt16

D - ToInt32

Answer : A

Explanation

ToDecimal() method converts a floating point or integer type to a decimal type.

Q 4 - Which of the following operator determines whether an object is of a certain type in C#?

A - ?:

B - is

C - as

D - *

Answer : B

Explanation

is operator determines whether an object is of a certain type.

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.

Answer : D

Explanation

All of the above options are correct.

Answer : D

Explanation

All of the above options are correct.

Q 9 - Which of the following preprocessor directive allows to create a compound conditional directive, along with #if in C#?

A - define

B - elif

C - if

D - else

Answer : D

Explanation

#else − It allows to create a compound conditional directive, along with #if.

Answer : C

Explanation

Both of the above options are correct.

csharp_questions_answers.htm
Advertisements