Vidyalelo
C# Programming · all questions

Basic Syntax and Data Types in C Sharp
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

115

Questions

2/6

Page

Pick an option on a question to see the right answer and solution.

What does the 'params' keyword do in C# method parameters?

Select an option to see the answer and solution.

In C#, what is the role of the 'finally' block in a try-catch-finally statement?

Select an option to see the answer and solution.

What is the correct syntax to define a multi-line comment in C#?

Select an option to see the answer and solution.

What is the purpose of the 'static' keyword in C#?

Select an option to see the answer and solution.

What is the result of the expression 10 % 3 in C#?

Select an option to see the answer and solution.

Which of the following is NOT a valid C# comment style?

Select an option to see the answer and solution.

What is the default value of a boolean variable in C# if not explicitly initialized?

Select an option to see the answer and solution.

What does the 'using' directive do in C#?

Select an option to see the answer and solution.

In C#, what is the purpose of the 'this' keyword?

Select an option to see the answer and solution.

What is the correct way to declare a constant in C#?

Select an option to see the answer and solution.

What is the correct way to declare a floating-point variable with single precision in C#?

Select an option to see the answer and solution.

Which of the following is a valid way to declare a constant string in C#?

Select an option to see the answer and solution.

What is the output of the following code: Console.WriteLine("10" + 5);

Select an option to see the answer and solution.

What is the default value of a reference type variable in C# if not explicitly initialized?

Select an option to see the answer and solution.

What is the purpose of the 'foreach' loop in C#?

Select an option to see the answer and solution.

What does the 'new' keyword do in C#?

Select an option to see the answer and solution.

Which data type is used to store true/false values in C#?

Select an option to see the answer and solution.

What is the correct way to declare a multi-dimensional array in C#?

Select an option to see the answer and solution.

What is the purpose of the 'is' keyword in C#?

Select an option to see the answer and solution.

In C#, what is the result of the expression 5 / 2?

Select an option to see the answer and solution.