C Sharp .Net Quiz Latest Quiz

C Sharp-.Net Quiz Latest Quiz

C# Interview Questions & Answers. What is C#? Explain types of comment in C# with examples, All quizzes on Programming  C# Sharp have answers available with pdf.

Here list of  important 30 C# interview questions and answers for C# developers who plan to attend the C# and .NET interviews.

Return to Programming Language Quiz List

Question 1: The Execution of the program begins with ________.

(A) main()

(B) get()

(C) class()

(D) display()

View Answer
(A) main()

Question 2: In c#, ‘using’ is a _________ .

(A) class

(B) directive

(C) function

(D) keyword

View Answer
Answer

Question 3: C# does not support __________ statement.

(A) go

(B) goto

(C) break

(D) continue

View Answer
(A) go

Question 4: “new” is used for __________ the objects.

(A) modifying

(B) creating

(C) allocating memory for

(D) deallocate memory of

View Answer
(C) allocating memory for

Question 5: C# supports ______________.

(A) for statement only

(B) for each statement only

(C) both for and for each statements

(D) neither for nor for each statement

View Answer
(C) both for and for each statements

Question 6: 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.

View Answer
(C) Both of the above.

Question 7: Which of the following converts a type to a byte value in C#?

(A) ToByte

(B) ToChar

(C) ToSingle

(D) ToDateTime

View Answer
(A) ToByte

Question 8: Which of the following preprocessor directive allows to create a compound conditional directive, along with #if in C#?

(A) elif

(B) else

(C) define

(D) if

View Answer
(B) else

Question 9: The ____ language allows more than one method in a single class.

(A) J#

(B) C#

(C) C++

(D) C

View Answer
(B) C#

Question 10: In C#, a subroutine is called a _________.

(A) Metadata

(B) Function

(C) Managed code

(D) Method

View Answer
(D) Method

Question 11: The character pair ?: is a __________ available in C#.

(A) Decision operator

(B) Unary operator

(C) Ternary operator

(D) Functional operator

View Answer
(C) Ternary operator

Question 12: C# all binary operators are ___________.

(A) Left-associative

(B) Top-associative

(C) Right-associative

(D) Center-associative

View Answer
(A) Left-associative

Question 13: A _____ is any valid C# variable ending with a colon.

(A) Bitwise

(B) goto

(C) Label

(D) Logical

View Answer
(C) Label

Question 14: C# has _______ operator, useful for making two way decisions.

(A) Looping

(B) Conditional

(C) Functional

(D) Exponential

View Answer
(B) Conditional

Question 15: Which property among the following represents the current position of the stream?

(A) long Position

(B) long Length

(C) int Length

(D) All of the mentioned

View Answer
(B) long Length

Question 16: Which keyword is used to refer baseclass constructor to subclass constructor in C#?

(A) static

(B) this

(C) extend

(D) base

View Answer
(D) base

Question 17: Which keyword is used for correct implementation of an interface in C#.NET?

(A) intf

(B) interface

(C) init

(D) iostream

View Answer
(B) interface 

Question 18: Select the correct statement about Attributes used in C#.NET?

(A) If a BugFixAttribute is to receive three parameters, then the BugFixAttribute class should implement a zero argument constructor

(B) The CLR can change the behavior of the code depending on attributes applied to it

(C) To create a custom attribute we need to create a custom attribute structure and derive it from System Attribute

(D) None of the above

View Answer
(B) The CLR can change the behavior of the code depending on attributes applied to it

Question 19: The [serializable()] attributes gets inspected at _________ time.

(A) run time

(B) compile time

(C) linking time

(D) design time

View Answer
(A) run time

Question 20: Which of the given stream methods provide access to the output console by default in C#.NET?

(A) Console.Out

(B) Console.In

(C) Console.Error

(D) All of the above

View Answer
(A) Console.Out

Question 21: The number of input methods defined by the stream method Console.In in C#.NET is?

(A) 4

(B) 3

(C) 2

(D) 1

View Answer
(B) 3

Question 22: The C# provides special methods known as _____  to provide access to data members.

(A) Methods method

(B) Loop method

(C) Accessor method

(D) Functions method

View Answer
(C) Accessor method

Question 23: Which method used to read byte streams from the file?

(A) Readkey()

(B) Read()

(C) ReadMore()

(D) ReadByte()

View Answer
(D) ReadByte()

Question 24: Select the method used to write single byte to a file?

(A) Wrteline()

(B) Write()

(C) WriteByte()

(D) None

View Answer
(C) WriteByte()

Question 25: Which of these is a method used to clear all the data present in output buffers?

(A) flush()

(B) close()

(C) clear()

(D) fflush()

View Answer
(A) flush()

Question 26: We can create empty structures in C#.NET.

(A) False

(B) True

(C) Maybe

(D) Can’t say

View Answer
(A) False

Question 27: Which of the following statements is correct about the using statement used in C#.NET?

(A) It is permitted to define a member at namespace level as a using alias.

(B) using statement can be placed anywhere in the C#.NET source code file.

(C) By using using statement it is possible to create an alias for the namespace but not for the namespace element.

(D) C#.NET source code file can contain any number of using statement.

View Answer
(D) C#.NET source code file can contain any number of using statement.

Question 28: Which of the following can not belong to a C#.NET Namespace?

(A) class

(B) enum

(C) struct

(D) data

View Answer
(D) data

Question 29: Choose the symbol which begins a preprocessor directive in C#.NET?

(A) #

(B) **

(C) *

(D) &

View Answer
(A) #

Question 30: In which of the following collections is the I/O based on a key?

(A) SortedList

(B) BitArray

(C) Stack

(D) Queue

View Answer
(A) SortedList