Vidyalelo
C# Programming · all questions

Introduction to C Sharp
practice.

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

60

Questions

2/3

Page

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

What is the purpose of the 'using' directive in C#?

Select an option to see the answer and solution.

Which operator is used for concatenation of strings in C#?

Select an option to see the answer and solution.

What is the output of the following code: Console.WriteLine(5 + 7 * 2);

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.

What does the 'new' keyword do 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.

In C#, what is the purpose of the 'static' keyword for class members?

Select an option to see the answer and solution.

What is the keyword used to exit a loop prematurely in C#?

Select an option to see the answer and solution.

What is the correct syntax to define a method in C#?

Select an option to see the answer and solution.

Which of the following is NOT a valid C# data type?

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.

Which keyword is used to explicitly derive one class from another in C#?

Select an option to see the answer and solution.

What is the result of the expression 3 / 2 in C#?

Select an option to see the answer and solution.

What is the maximum value that an int data type can hold in C#?

Select an option to see the answer and solution.

Which of the following is NOT a comparison operator in C#?

Select an option to see the answer and solution.

What is the keyword used to declare a method that does not return a value in C#?

Select an option to see the answer and solution.

In C#, how do you create a single-line comment?

Select an option to see the answer and solution.

What is the correct way to declare an array in C#?

Select an option to see the answer and solution.

Which of the following is NOT a valid method of string concatenation in C#?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.