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 2 of 16
Explore more Topics under C# programming
int[] intMyArr = {11, 3, 5, 9, 4};
1.
int[] a = {25, 30, 40, 5};
2.
int[] a;
a = new int[3];
a[0] = 25;
a[1] = 30;
a[2] = 40;
a[3] = 5;
3.
int[] a;
a = new int{25, 30, 40, 5};
4.
int[] a;
a = new int[4]{25, 30, 40, 5};
5.
int[] a;
a = new int[4];
a[0] = 25;
a[1] = 30;
a[2] = 40;
a[3] = 5;
int[][] a = new int[2][];
a[0] = new int[4]{6, 1, 4, 3};
a[1] = new int[3]{9, 2, 7};
Console.WriteLine(a[1].GetUpperBound(0));
int[] intMyArr = {25, 30, 45, 15, 60};
1. intMyArr.GetMax;
2. intMyArr.Highest(0);
3. intMyArr.GetUpperBound(0);
4. intMyArr.Length;
5. intMyArr.GetMaxElements(0);
namespace CompScibitsConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
int i, j;
int[ , ] arr = new int[ 2, 2 ];
for(i = 0; i < 2; ++i)
{
for(j = 0; j < 2; ++j)
{
arr[i, j] = i * 17 + i * 17;
Console.Write(arr[ i, j ] + " ");
}
}
}
}
}
1. String objects cannot be created without using new.
2. Only one object will get created.
3. s1 and s2 both will refer to the same object.
4. Two objects will get created, one pointed to by s1 and another pointed to by s2.
5. s1 and s2 are references to the same object.
String s1, s2;
s1 = "Hi";
s2 = "Hi";
String s1 = "ALL MEN ARE CREATED EQUAL";
String s2;
s2 = s1.Substring(12, 3);
Console.WriteLine(s2);
String s2;
s2 = String.Copy(s1);
String s1 = "Nagpur";
String s2;
s2 = s1.Insert(6, "Mumbai");
Console.WriteLine(s2);
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!