Arrays And Strings In C Sharp — Part 2 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Arrays And Strings In C Sharp — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C#, what method is used to convert a string to an array of characters?
Correct Answer: Option D — ToCharArray()
Detailed Academic Explanation:
ToCharArray() is the correct answer to “In C#, what method is used to convert a string to an array of characters”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the correct way to declare and initialize a jagged array with 2 rows in C#?
Correct Answer: Option A — int[][] jaggedArray = new int[2][]
Detailed Academic Explanation:
int[][] jaggedArray = new int[2][] is the correct answer to “What is the correct way to declare and initialize a jagged array with 2 rows in C#”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the correct syntax to access the second character of a string named text in C#?
Correct Answer: Option D — text[1]
Detailed Academic Explanation:
text[1] is the correct answer to “What is the correct syntax to access the second character of a string named text in C#”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the result of the expression Array.IndexOf(numbers, 5) where numbers = {1, 2, 3, 4, 5} in C#?
Correct Answer: Option C — 4
Detailed Academic Explanation:
4 is the correct answer to “What is the result of the expression Array.IndexOf(numbers, 5) where numbers = {1, 2, 3, 4, 5} in C#”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C#, which method is used to split a string into substrings based on a specified delimiter?
Correct Answer: Option B — Split()
Detailed Academic Explanation:
Split() is the correct answer to “In C#, which method is used to split a string into substrings based on a specified delimiter”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the correct way to declare and initialize a multidimensional array with 3 rows and 4 columns in C#?
Correct Answer: Option C — int[,] matrix = new int[3, 4]
Detailed Academic Explanation:
int[,] matrix = new int[3, 4] is the correct answer to “What is the correct way to declare and initialize a multidimensional array with 3 rows and 4 columns in C#”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# 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(); } }
Correct Answer: Option C — 40, 12
Detailed Academic Explanation:
40, 12 is the correct answer to “What will be the output of the following C# 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(); } }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these base classes are accessible to the derived class members?
Correct Answer: Option B — protected
Detailed Academic Explanation:
protected is the correct answer to “Which of these base classes are accessible to the derived class members”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the process by which we can control parts of a program that can access the members of a class?
Correct Answer: Option C — Encapsulation
Detailed Academic Explanation:
Encapsulation is the correct answer to “What is the process by which we can control parts of a program that can access the members of a class”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods of class are used to remove the leading and backward whitespaces?
Correct Answer: Option C — doTrim()
Detailed Academic Explanation:
doTrim() is the correct answer to “Which of these methods of class are used to remove the leading and backward whitespaces”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { String a = "Ilove"; String b = "CSHARP"; b = string.Concat(a, ' ', b); Console.WriteLine(b); Console.ReadLine(); }
Correct Answer: Option D — Ilove CSHARP
Detailed Academic Explanation:
Ilove CSHARP is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { String a = "Ilove"; String b = "CSHARP"; b = string.Concat(a, ' ', b); Console.WriteLine(b); Console.ReadLine(); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { String obj = "hello"; String obj1 = "world"; String obj2 = obj; string s = obj+" "+obj1; Console.WriteLine(s.IndexOf('r')); Console.ReadLine(); }
Correct Answer: Option B — 8
Detailed Academic Explanation:
8 is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { String obj = "hello"; String obj1 = "world"; String obj2 = obj; string s = obj+" "+obj1; Console.WriteLine(s.IndexOf('r')); Console.ReadLine(); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What does the term 'immutable' means in term of string objects?
Correct Answer: Option B — We cannot modify characters contained in the string
Detailed Academic Explanation:
We cannot modify characters contained in the string is the correct answer to “What does the term 'immutable' means in term of string objects”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
public, private, protected, internal, protected internal is the correct answer to “Accessibility modifier defined in a class are”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods is an alternative to getChars() that stores the characters in an array of bytes?
Correct Answer: Option A — getBytes()
Detailed Academic Explanation:
getBytes() is the correct answer to “Which of these methods is an alternative to getChars() that stores the characters in an array of bytes”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# 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; }
Correct Answer: Option B — 5040
Detailed Academic Explanation:
5040 is the correct answer to “What will be the output of the following C# 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; }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { String obj = "hello"; String obj1 = "world"; String obj2 = obj; string s = obj + " " + obj1; Console.WriteLine(s.Substring(6 ,5)); Console.ReadLine(); }
Correct Answer: Option C — world
Detailed Academic Explanation:
world is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { String obj = "hello"; String obj1 = "world"; String obj2 = obj; string s = obj + " " + obj1; Console.WriteLine(s.Substring(6 ,5)); Console.ReadLine(); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? 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(); } }
0, 0, 0 4, 4, 4 8, 8, 8 is the correct answer to “What will be the output of the following C# code? 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(); } }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The modifiers used to define an array of parameters or list of arguments is . . . . . . . .
Correct Answer: Option C — param
Detailed Academic Explanation:
param is the correct answer to “The modifiers used to define an array of parameters or list of arguments is . . . . . . . .”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { object[] a = {" 1 ", 4.0f, " harsh "}; fun(a); Console.ReadLine(); } static void fun(params object[] b) { for (int i = 0; i < b.Length - 1; i++) Console.WriteLine(b[i] + " "); }
Correct Answer: Option D — 1 4 harsh
Detailed Academic Explanation:
1 4 harsh is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { object[] a = {" 1 ", 4.0f, " harsh "}; fun(a); Console.ReadLine(); } static void fun(params object[] b) { for (int i = 0; i < b.Length - 1; i++) Console.WriteLine(b[i] + " "); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Select the correct match of parameter declaration. static Void main(string[] args) { int a = 5; int b = 6; float c = 7.2f; math (ref a, ref b, ref c); Console.WriteLine(a + " " + b + " " + c); } static int math(/*add parameter declaration */) { a += b; b *= (int)c; c += a * b; return 0; }
Correct Answer: Option D — ref int a, ref int b, ref float c
Detailed Academic Explanation:
ref int a, ref int b, ref float c is the correct answer to “Select the correct match of parameter declaration. static Void main(string[] args) { int a = 5; int b = 6; float c = 7.2f; math (ref a, ref b, ref c); Console.WriteLine(a + " " + b + " " + c); } static int math(/*add parameter declaration */) { a += b; b *= (int)c; c += a * b; return 0; }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { int[] x = { 80, 82, 65, 72, 83, 67 }; fun(x); Console.ReadLine(); } static void fun(params int [] b ) { int i; for (i = 5; i >=0 ; i--) { Console.WriteLine(Convert.ToChar(b[i])); } }
Correct Answer: Option C — C S H A R P
Detailed Academic Explanation:
C S H A R P is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { int[] x = { 80, 82, 65, 72, 83, 67 }; fun(x); Console.ReadLine(); } static void fun(params int [] b ) { int i; for (i = 5; i >=0 ; i--) { Console.WriteLine(Convert.ToChar(b[i])); } }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code snippet? static void Main(string[] args) { string c = "hello"; string c1 = c.Remove(1); Console.WriteLine(c1); Console.ReadLine(); }
Correct Answer: Option B — h
Detailed Academic Explanation:
h is the correct answer to “What will be the output of the following C# code snippet? static void Main(string[] args) { string c = "hello"; string c1 = c.Remove(1); Console.WriteLine(c1); Console.ReadLine(); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which method does following C# 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; }
Correct Answer: Option A — Call by reference
Detailed Academic Explanation:
Call by reference is the correct answer to “Which method does following C# 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; }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { int [] a = {1, 2, 3, 4, 5}; fun(a); Console.ReadLine(); } static void fun(params int[] b ) { for (int i = 0; i < b.Length; i++) { b[i] = b[i] * 5 ; Console.WriteLine(b[i] + ""); } }
Correct Answer: Option B — 5, 10, 15, 20, 25
Detailed Academic Explanation:
5, 10, 15, 20, 25 is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { int [] a = {1, 2, 3, 4, 5}; fun(a); Console.ReadLine(); } static void fun(params int[] b ) { for (int i = 0; i < b.Length; i++) { b[i] = b[i] * 5 ; Console.WriteLine(b[i] + ""); } }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these data type values is returned by equals() method of String class?
Correct Answer: Option C — boolean
Detailed Academic Explanation:
boolean is the correct answer to “Which of these data type values is returned by equals() method of String class”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which statement is correct about following C# code? int[, ]a={{5, 4, 3},{9, 2, 6}};
Correct Answer: Option C — 'a' represents rectangular array of 2 columns and 3 arrays
Detailed Academic Explanation:
'a' represents rectangular array of 2 columns and 3 arrays is the correct answer to “Which statement is correct about following C# code? int[, ]a={{5, 4, 3},{9, 2, 6}};”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? class Program { static void Main(string[] args) { String s1 = "I love You"; String s2 = s1; Console.WriteLine((s1 == s2) + " " + s1.Equals(s2)); Console.ReadLine(); } }
Correct Answer: Option A — true true
Detailed Academic Explanation:
true true is the correct answer to “What will be the output of the following C# code? class Program { static void Main(string[] args) { String s1 = "I love You"; String s2 = s1; Console.WriteLine((s1 == s2) + " " + s1.Equals(s2)); Console.ReadLine(); } }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Correct way to convert a string to uppercase using string class method()?
Correct Answer: Option C — Object.ToUpper()
Detailed Academic Explanation:
Object.ToUpper() is the correct answer to “Correct way to convert a string to uppercase using string class method()”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { string s = " i love you"; Console.WriteLine(s.IndexOf('l') + " " + s.lastIndexOf('o') + " " + s.IndexOf('e')); Console.ReadLine(); }
Correct Answer: Option C — 3 9 6
Detailed Academic Explanation:
3 9 6 is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { string s = " i love you"; Console.WriteLine(s.IndexOf('l') + " " + s.lastIndexOf('o') + " " + s.IndexOf('e')); Console.ReadLine(); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The Method use to remove white space from a string?
Correct Answer: Option C — Trim()
Detailed Academic Explanation:
Trim() is the correct answer to “The Method use to remove white space from a string”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Correct way to find if contents of two strings are equal?
Correct Answer: Option C — if (strcmp (s1 ,s2))
Detailed Academic Explanation:
if (strcmp (s1 ,s2)) is the correct answer to “Correct way to find if contents of two strings are equal”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to convert all characters in a String into a character array?
Correct Answer: Option C — TocharArray()
Detailed Academic Explanation:
TocharArray() is the correct answer to “Which of these methods can be used to convert all characters in a String into a character array”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { String c = "Hello"; String a ; a = c.Replace('l', 'w'); Console.WriteLine(a); Console.ReadLine(); }
Correct Answer: Option D — Hewwo
Detailed Academic Explanation:
Hewwo is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { String c = "Hello"; String a ; a = c.Replace('l', 'w'); Console.WriteLine(a); Console.ReadLine(); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code snippet? static void Main(string[] args) { String c = "Hello i love you"; String a ; a = c.Substring(12, 3); Console.WriteLine(a); Console.ReadLine(); }
Correct Answer: Option C — yo
Detailed Academic Explanation:
yo is the correct answer to “What will be the output of the following C# code snippet? static void Main(string[] args) { String c = "Hello i love you"; String a ; a = c.Substring(12, 3); Console.WriteLine(a); Console.ReadLine(); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following statements are correct?
Correct Answer: Option B — String literals can contain any character literal including escape sequences
Detailed Academic Explanation:
String literals can contain any character literal including escape sequences is the correct answer to “Which of the following statements are correct”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { String obj = "hello"; String obj1 = "world"; String obj2 = obj; Console.WriteLine(obj + " " + obj1); string s = obj + " " + obj1; Console.WriteLine(s.Length); Console.ReadLine(); }
Correct Answer: Option C — hello world 11
Detailed Academic Explanation:
hello world 11 is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { String obj = "hello"; String obj1 = "world"; String obj2 = obj; Console.WriteLine(obj + " " + obj1); string s = obj + " " + obj1; Console.WriteLine(s.Length); Console.ReadLine(); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods returns the string such that some characters which are specified to be removed from the end of strings are removed from string by mentioning the number of characters to be removed?
Correct Answer: Option A — Trim()
Detailed Academic Explanation:
Trim() is the correct answer to “Which of these methods returns the string such that some characters which are specified to be removed from the end of strings are removed from string by mentioning the number of characters to be removed”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C# code? static void Main(string[] args) { String obj = "hello"; String obj1 = "world"; String obj2 = obj; Console.WriteLine (obj.Equals(obj2) + " " + obj2.CompareTo(obj) ); Console.ReadLine(); }
Correct Answer: Option C — True 0
Detailed Academic Explanation:
True 0 is the correct answer to “What will be the output of the following C# code? static void Main(string[] args) { String obj = "hello"; String obj1 = "world"; String obj2 = obj; Console.WriteLine (obj.Equals(obj2) + " " + obj2.CompareTo(obj) ); Console.ReadLine(); }”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
To perform comparison operation on strings supported operations are . . . . . . . .
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “To perform comparison operation on strings supported operations are . . . . . . . .”. This question is standard in competitive examination syllabi for Arrays And Strings In C Sharp.
💡Key Conceptual Anchor:Arrays And Strings In C Sharp
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.