Vidyalelo
C# Programming · Q52

Arrays and Strings in C Sharp

Programming · C# Programming · question 52

Q52

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();

A.
7
B.
8
Answer
C.
9
D.
10

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board