0% found this document useful (0 votes)
67 views4 pages

C#-Quiz II

This document contains 10 multiple choice questions about C# concepts like variable naming conventions, value types, converting data types to date-time structures, pointers, passing arguments by value vs reference, checking if an array is readonly, default access specifiers for class members, overloading comparison operators, undefining preprocessor symbols, and using catch blocks. Each question is followed by 4 possible answers with the correct answer indicated. The questions cover a range of fundamental C# programming topics.

Uploaded by

Syed Ibrahim K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views4 pages

C#-Quiz II

This document contains 10 multiple choice questions about C# concepts like variable naming conventions, value types, converting data types to date-time structures, pointers, passing arguments by value vs reference, checking if an array is readonly, default access specifiers for class members, overloading comparison operators, undefining preprocessor symbols, and using catch blocks. Each question is followed by 4 possible answers with the correct answer indicated. The questions cover a range of fundamental C# programming topics.

Uploaded by

Syed Ibrahim K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Q 1 - Which of the following is correct about variable naming conventions in C#?

A - It should not be a C# keyword.

B - It must not contain any embedded space or symbol such as? - + ! @ # % ^ & * ( ) [ ] { }

C - Both of the above.

D - None of the above.

Answer : C

Q 2 - Value type variables in C# are derived from the class System.ValueType?

A - true

B - false

Answer : A

Q 3 - Which of the following converts a type (integer or string type) to date-time structures in
C#?

A - ToString

B - ToSingle

C - ToChar

D - ToDateTime

Answer : D

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

A - sizeof

B - typeof
C-&

D-*

Answer : D

Q 5 - Which of the following method copies the actual value of an argument into the formal
parameter of the function?

A - Value parameters

B - Reference parameters

C - Output parameters

D - None of the above.

Answer : A

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

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

A - Private
B - Public

C - Protected

D - Internal

Answer : A

Q 8 - The comparison operators can be overloaded.

A - true

B - false

Answer : A

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

Q 10 - Which of the following is true about catch block in C#?

A - A program catches an exception with an exception handler at the place in a program where
you want to handle the problem.

B - The catch keyword indicates the catching of an exception.


C - Both of the above.

D - None of the above.

Answer : C

You might also like