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.
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 4 of 16
Explore more Topics under C# Programming
1. String is a value type.
2. String literals can contain any character literal including escape sequences.
3. The equality operators are defined to compare the values of string objects as well as references.
4. Attempting to access a character that is outside the bounds of the string results in an IndexOutOfRangeException.
5. The contents of a string object can be changed after the object is created.
int i, j;
i = str.IndexOf("s");
j = str.IndexOf("s", i + 1);
static void Main(string[] args)
{
int i, j;
int[, ] arr = new int[ 3, 3];
for (i = 0; i < 3; ++i)
{
for (j = 0; j < 3; ++j)
{
arr[i, j] = i * 2 + i * 2;
Console.WriteLine(arr[i, j]);
}
Console.ReadLine();
}
}
static void Main(string[] args)
{
char A = 'K';
char B = Convert.ToChar(76);
A++;
B++;
Console.WriteLine(A+ " " +B);
Console.ReadLine();
}
int[][]a = new int[2][];
a[0] = new int[3]{3, 4, 2};
a[1] = new int[2]{8, 5};
foreach( int[]i in a)
{
/* add for loop */
console.write( j+ " ");
console.writeline();
}
static void Main(string[] args)
{
double a = 345.09;
byte c = (byte) a;
Console.WriteLine(c);
Console.ReadLine();
}
int[] a= {11, 3, 5, 9, 6};
int[, ]a={{5, 4, 3},{9, 2, 6}};
static void Main(string[] args)
{
Program p = new Program();
p.display(2, 3, 8);
int []a = { 2, 56, 78, 66 };
Console.WriteLine("example of array");
Console.WriteLine("elements added are");
p.display(a);
Console.ReadLine();
}
public void display(params int[] b)
{
foreach (int i in b)
{
Console.WriteLine("ARRAY IS HAVING:{0}", i);
}
}
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!