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

Answer : B

Explanation

When an object type is converted to a value type, it is called unboxing.

Q 3 - Which of the following converts a type to a small floating point number in C#?

A - ToInt64

B - ToSbyte

C - ToSingle

D - ToInt32

Answer : C

Explanation

ToSingle() method converts a type to a small floating point number.

Q 4 - Which of the following operator creates a pointer to a variable in C#?

A - sizeof

B - typeof

C - &

D - *

Answer : D

Explanation

* operator creates a pointer to a variable.

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# gets a 64-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 : B

Explanation

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

Q 7 - Which of the following is the default access specifier of a class member function?

A - Private

B - Public

C - Protected

D - Internal

Answer : A

Explanation

Default access for the class member function is Private.

Q 8 - C# does not support multiple inheritance.

A - true

B - false

Answer : A

Explanation

C# does not support multiple inheritance.

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.

csharp_questions_answers.htm
Advertisements