![Csharp Tutorial](/csharp/images/csharp-mini-logo.jpg)
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
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](/images/questions_and_answers.png)
Q 1 - Which of the following is correct about variable naming conventions in C#?
Answer : C
Explanation
Both of the above options are correct.
Q 2 - Which of the following is correct about value type variables in C#?
A - The value types directly contain data.
C - When you declare an int type, the system allocates memory to store the value.
Answer : D
Explanation
All of the above options are correct.
Q 3 - Which of the following converts a type to a 16-bit integer in C#?
Answer : C
Explanation
ToInt16() method converts a type to a 16-bit integer.
Q 4 - Which of the following converts a type to an unsigned long type in C#?
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 in the current assembly?
Answer : D
Explanation
Internal access specifier allows a class to expose its member variables and member functions to other functions and objects in the current assembly.
Q 6 - Which of the following property of Array class in C# checks whether the Array has a fixed size?
Answer : A
Explanation
IsFixedSize gets a value indicating whether the Array has a fixed size.
Q 7 - Which of the following is the default access specifier of a class member variable?
Answer : A
Explanation
Default access for the class member variables is Private.
Answer : A
Explanation
Function overloading is a kind of static polymorphism.
Answer : A
Explanation
You can define one namespace inside another namespace. You can access members of nested namespace by using the dot (.) operator.
Q 10 - Which of the following preprocessor directive allows generating a level one warning from a specific location in your code in C#?
Answer : A
Explanation
#warning − It allows generating a level one warning from a specific location in your code.