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 3 - Which of the following converts a type to a 64-bit integer in C#?

A - ToInt64

B - ToSbyte

C - ToSingle

D - ToInt32

Answer : A

Explanation

ToInt64() method converts a type to a 64-bit integer.

Q 4 - Which of the following operator represents a conditional operation in C#?

A - ?:

B - is

C - as

D - *

Answer : A

Explanation

?: operator represents a conditional operation.

Q 5 - Which of the following method helps in returning more than one value?

A - Value parameters

B - Reference parameters

C - Output parameters

D - None of the above.

Answer : C

Explanation

Output parameters method helps in returning more than one value.

Q 6 - Which of the following property of Array class in C# checks whether the Array is readonly?

A - IsFixedSize

B - IsReadOnly

C - Length

D - None of the above.

Answer : B

Explanation

IsReadOnly gets a value indicating whether the Array is readonly.

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 - Function overloading is a kind of static polymorphism.

A - true

B - false

Answer : A

Explanation

Function overloading is a kind of static polymorphism.

Q 9 - Which of the following preprocessor directive allows generating an error from a specific location in your code in C#?

A - define

B - region

C - line

D - error

Answer : D

Explanation

#error − It allows generating an error from a specific location in your code.

Answer : C

Explanation

Both of the above options are correct.

csharp_questions_answers.htm
Advertisements