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# by prefixing them with @ character?

A - true

B - false

Answer : A

Explanation

if you want to use these keywords as identifiers, you may prefix the keyword with the @ character.

Q 2 - Which of the following converts a type to a byte value in C#?

A - ToSingle

B - ToByte

C - ToChar

D - ToDateTime

Answer : B

Explanation

ToByte() method converts a type to a byte.

Q 3 - Which of the following converts a type to a 32-bit integer in C#?

A - ToDecimal

B - ToDouble

C - ToInt16

D - ToInt32

Answer : D

Explanation

ToInt32() method converts a type to a 32-bit integer.

Q 4 - Which of the following converts a type to an unsigned big type in C#?

A - ToType

B - ToUInt16

C - ToUInt32

D - ToUInt64

Answer : D

Explanation

ToUInt64() method converts a type to an unsigned big type.

Q 5 - Which of the following method copies the reference to the memory location of an argument into the formal parameter?

A - Value parameters

B - Reference parameters

C - Output parameters

D - None of the above.

Answer : B

Explanation

Reference parameters method copies the reference to the memory location of an argument into the formal parameter.

Q 6 - Which of the following property of Array class in C# checks whether the Array has a fixed size?

A - IsFixedSize

B - IsStatic

C - Length

D - None of the above.

Answer : A

Explanation

IsFixedSize gets a value indicating whether the Array has a fixed size.

Q 8 - C# supports multiple inheritance.

A - true

B - false

Answer : B

Explanation

C# does not support multiple inheritance.

Q 9 - Which of the following preprocessor directive lets you modify the compiler's line number and (optionally) the file name output for errors and warnings in C#?

A - elif

B - endif

C - line

D - region

Answer : C

Explanation

#line − It lets you modify the compiler's line number and (optionally) the file name output for errors and warnings.

Answer : C

Explanation

Both of the above options are correct.

csharp_questions_answers.htm
Advertisements