Vidyalelo
C# Programming · all questions

Arrays and Strings in C Sharp
practice.

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

134

Questions

2/7

Page

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

What is the correct way to access the third element in an array named numbers in C#?

Select an option to see the answer and solution.

What is the correct way to declare a string array named colors with three elements in C#?

Select an option to see the answer and solution.

In C#, which method is used to copy elements from one array to another?

Select an option to see the answer and solution.

What is the result of the expression string[] names = {"John", "Alice", "Bob"}; in C#?

Select an option to see the answer and solution.

What is the correct way to access the length of an array named numbers in C#?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

In C#, which method is used to sort the elements of an array?

Select an option to see the answer and solution.

What is the correct syntax to declare a multidimensional array in C#?

Select an option to see the answer and solution.

What does the Split() method do when applied to a string in C#?

Select an option to see the answer and solution.

In C#, which method is used to convert an array to a string representation?

Select an option to see the answer and solution.

What is the correct way to access the last element in an array named numbers in C#?

Select an option to see the answer and solution.

Which method is used to concatenate two or more strings in C#?

Select an option to see the answer and solution.

What is the correct syntax to declare a 2D array with 3 rows and 4 columns in C#?

Select an option to see the answer and solution.

What is the result of the expression string[] fruits = {"Apple", "Banana", "Orange"}; in C#?

Select an option to see the answer and solution.

In C#, which method is used to find the index of the first occurrence of a specified value in an array?

Select an option to see the answer and solution.

What is the correct way to declare and initialize a string array with three elements in C#?

Select an option to see the answer and solution.

In C#, what is the correct way to access the length of a string named text?

Select an option to see the answer and solution.

What does the IndexOf() method return if the specified value is not found in an array in C#?

Select an option to see the answer and solution.

What is the purpose of the Reverse() method when applied to an array in C#?

Select an option to see the answer and solution.

In C#, what method is used to convert a string to an array of characters?

Select an option to see the answer and solution.