adplus-dvertising

Welcome to the Arrays and Strings MCQs Page

Dive deep into the fascinating world of Arrays and Strings with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Arrays and Strings, a crucial aspect of C# Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Arrays and Strings, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C# Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Arrays and Strings. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C# Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Arrays and Strings. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Arrays and Strings MCQs | Page 5 of 16

Explore more Topics under C# Programming

Discuss
Answer: (d).int[] a;
a = new int[3]{78, 9, 54};
Discuss
Answer: (a).Declaring array in C# the square bracket([]) comes after the type but not after identifier
Q43.
Which of the following string() method are used to compare two strings with each other?
Discuss
Answer: (b).Copy()
Q44.
Choose the base class for string() method :
Discuss
Answer: (c).System.String
Q45.
What is output for the following set of code:
static void Main(string[] args)
 {
     string s1 = " Cshr ";
     string s2 = s1.Insert(3 , " a ");
     string s3 = s2.Insert(5 , " p ");
     for (int i = 0;i < s3.Length; i++)
     Console.WriteLine(s3[i]);
     Console.ReadLine();
 }
Discuss
Answer: (c).Csharp
Discuss
Answer: (b).A string has a zero-based index
Q47.
What is output for the following set of code?
static void Main(string[] args)
 {
     string s1 = "Hello";
     string s2 = "hello";
     if (s1 == s2)
     Console.WriteLine("Equal");
     else
     Console.WriteLine("Unequal");
     if (s1.Equals (s2))
     Console.WriteLine("Equal");
     else
     Console.WriteLine("Unequal");
     Console.ReadLine();
 }
Discuss
Answer: (d).Unequal
Unequal
Q48.
Choose Output for the following set of code :
static void Main(string[] args)
{
    string s1 = "Hello" + " I " + "Love" + " ComputerScience ";
    Console.WriteLine(s1);
    Console.ReadLine();
}
Discuss
Answer: (b).Hello I Love ComputerScience
Q49.
Correct way to find if contents of two strings are equal ?
Discuss
Answer: (c).if (strcmp (s1 ,s2))
Discuss
Answer: (b).String literals can contain any character literal including escape sequences

Suggested Topics

Are you eager to expand your knowledge beyond C# Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!