Examveda

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

C. 9

D. 10

Answer: Option B


Join The Discussion

Related Questions on Arrays and Strings in C Sharp