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.

Answer : C

Explanation

Both of the above options are correct.

Q 3 - Which of the following converts a type to a string in C#?

A - ToInt64

B - ToSbyte

C - ToSingle

D - ToString

Answer : D

Explanation

ToString() method converts a type to a string.

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

A - ToType

B - ToUInt16

C - ToUInt32

D - ToString

Answer : C

Explanation

ToUInt32() method converts a type to an unsigned long type.

Q 5 - Which of the following access specifier in C# allows a class to expose its member variables and member functions to other functions and objects?

A - Public

B - Private

C - Protected

D - Internal

Answer : A

Explanation

Public access specifier allows a class to expose its member variables and member functions to other functions and objects.

Q 8 - The conditional logical operators can be overloaded.

A - true

B - false

Answer : B

Explanation

The conditional logical operators cannot be overloaded.

Q 9 - Which of the following preprocessor directive specifies the end of a conditional directive in C#?

A - elif

B - endif

C - if

D - else

Answer : B

Explanation

#endif − Specifies the end of a conditional directive.

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