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 14 of 16

Explore more Topics under C# Programming

Q131.
Method used to remove white space from string?
Discuss
Answer: (c).Trim()
Q132.
What will be the output of the given code snippet?
static void Main(string[] args)
 {
     string s1 = "olleH";
     string s2 = "olleh";
     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
Q133.
What will be the output of the given code snippet?
static void Main(string[] args)
{
    string s1 = " Ixg";
    string s2 = s1.Insert(3,"i");
    string s3 = s2.Insert(5, "o");
    for (int i = 0; i < s3.Length; i++)
    Console.WriteLine(s3[i]);
    Console.ReadLine();
}
Discuss
Answer: (c).Ixigo
Q134.
What will be the output of the given code snippet?
class Program
 {
     static void Main(string[] args)
     {
         char []chars = {'a', 'b', 'c'};
         String s = new String(chars);
         Console.WriteLine(s);
         Console.ReadLine();
     }
 }
Discuss
Answer: (d).abc
Q135.
What will be the output of given code snippet?
class Program
 {
     static void Main(string[] args)
     {
         char []chars = {'a', 'b', 'c'};
         String s = new String(chars);
         String s1 = "abcd";
         int len1 = s1.Length;
         int len2 = s.Length;
         Console.WriteLine(len1 + " " + len2);
         Console.ReadLine();
     }
 }
Discuss
Answer: (d).4 3
Q136.
What will be the output of given code snippet?
class A
 {
     int i;
     int j;
     public A()
     {
         i = 1;
         j = 2;
     }
 }
 class Program
 {
     static void Main(string[] args)
     {
         A obj1 = new A();
  Console.WriteLine(obj1.ToString());
         Console.ReadLine();
     }
 }
Discuss
Answer: (c).String associated with obj1
Q137.
Which of these constructors is used to create an empty String object?
Discuss
Answer: (a).String()
Q138.
Which of these method of class String is used to obtain length of String object?
Discuss
Answer: (d).Length()
Q139.
What will be the output of the given code snippet?
class Program
 {
     static void Main(string[] args)
     {
         String c = "Hello i love Csharp";
         Boolean var;
  var = c.StartsWith("hello");
         Console.WriteLine(var);
         Console.ReadLine();
     }
 }
Discuss
Answer: (b).False
Q140.
What is the value returned by the function CompareTo() if the invoking string is less than the string compared?
Discuss
Answer: (b).value less than zero

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!