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

Explore more Topics under C# Programming

Discuss
Answer: (a).On a character by character basis
Discuss
Answer: (c).Console.WriteLine(โ€œ\\\\โ€);
Q93.
Which of these is used as a default specifier for a member of the class if no access specifier is used for it?
Discuss
Answer: (a).private
Q94.
Which of these is used to access members of class before the object of that class is created?
Discuss
Answer: (c).static
Q95.
Which of these base classes are accessible to the derived class members?
Discuss
Answer: (b).protected
Q96.
What is the process by which we can control parts of a program that can access the members of a class?
Discuss
Answer: (c).Encapsulation
Q97.
What will be the output of the following set of code?
class sum   
 {
     public int x;
     private int y;
     public void math(int a, int b)
     {
         x = a * 4;
         y = b;
     }
 }    
 class Program
 {
     static void Main(string[] args)
     {
         sum p = new sum();   
         p.math(12, 30);
         Console.WriteLine(p.x + "  " + p.y);
         Console.ReadLine();
     }
 }
Discuss
Answer: (d).Compile time error
Q98.
What will be the output of the following set of code?
class sum   
 {
     public int x;
     public int y;
     public  int add (int a,  int b)
     {
         x = a + b;
         y = x + b;
         return 0;
     }
 }    
 class Program
 {
     static void Main(string[] args)
     {
         sum obj1 = new sum();
         sum obj2 = new sum();   
         int a = 2;
         obj1.add(a,  a + 1);
         obj2.add(5,  a);
         Console.WriteLine(obj1.x + "  " + obj2.y);     
         Console.ReadLine();
     }
 }
Discuss
Answer: (b).5, 9
Q99.
What will be the output of the following code?
class math
 {
     public int a,b;
     public math(int i,  int j)
     {
         a = i;
         b = j;
     }
     public  void sum(math m)
     {
         m.a *= 2;
         m.b += 2;
     }
 }    
 class Program
 {
     static void Main(string[] args)
     {
         math t = new math(20,  10);
         t.sum(t);
         Console.WriteLine(t.a + "  " + t.b);   
         Console.ReadLine();
     }
 }
Discuss
Answer: (c).40, 12
Discuss
Answer: (d).public, private, protected, internal, protected internal

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!