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#?

A - true

B - false

Answer : B

Explanation

Keywords are reserved words predefined to the C# compiler. These keywords cannot be used as identifiers.

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

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

Q 10 - The System.SystemException class is the base class for all predefined system exception in C#?

A - true

B - false

Answer : A

Explanation

The System.SystemException class is the base class for all predefined system exception.

csharp_questions_answers.htm
Advertisements