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

Explore more Topics under C# Programming

Discuss
Answer: (a).The base class member functions can access public member functions of derived class
Q102.
Which of these access specifiers must be used for main() method?
Discuss
Answer: (a).private
Q103.
What is output for the following code snippet?
Discuss
Answer: (b).10, 36
Discuss
Answer: (d).All of the mentioned
Q105.
What will be the output for the given set of code?
static void main(string[] args)
 {
     int n = 1;
     method(n);
     console.Writeline(n);
     method1(ref n);
     console.Writeline(n);
 }
 static void method(int num)
 {
     num += 20;
     console.writeline(num);
 }
 static void method1(ref int num)
 {
     num += 20;
     console.writeline(num);
 }
Discuss
Answer: (d).21
1
21
21
Q106.
Which method does following set of code explains?
static void Main(string[] args)
 {
     int a = 10, b = 20;
     method(ref a,  ref b);
     console.writeline(a + "  " + b);
 }
 static void swap(ref int i,  ref int j)
 {  
     int t;
     t = i;
     i = j;
     j = t;
 }
Discuss
Answer: (a).Call by reference
Q107.
What will be the output for the given set of code?
static void main(string[] args)
 {
     int []arr = new int[]{ 1, 2, 3, 4, 5};
     fun (ref arr);
     for (int i = 0; i < arr.Length ; i++)
     Console.WriteLine( arr[i] + "  ");
 }
 static void fun(ref int[]a)
 {
     a = new int[6];
     a[3] = 32;
     a[1] = 24;
 }
Discuss
Answer: (b).0, 24, 0, 32, 0, 0
Q108.
What will be the output of given set of code?
static void main(string[] args)
 {
     int i;
     int res = fun (out i);
     console.writeline(res);
     console.readline();
 }
 static int fun(out int i)
 {
     int s = 1;
     i = 7;
     for (int j = 1; j <= i; j++ )
     s = s * j;
     return s;
 }
Discuss
Answer: (b).5040
Q109.
What will be the output of the given set of code?
static void Main(string[] args)
 {
     int a = 5;
     int b = 0, c = 0;
     method (a,  ref b, ref c);
     Console.WriteLine(b + "  " + c);
     Console.ReadLine();
 }
 static int method(int x, int p, ref int k)
 {
     p = x + x * x;
     k = x * x + p;
     return 0;
 }
Discuss
Answer: (c).Compile time error
Q110.
Keyword used to define call by reference parameter in C# .NET?
Discuss
Answer: (c).ref

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!