Examveda

What will be the output of the following C# code snippet?
static void Main(string[] args)
{
    String a ="i love iostream";
    Console.WriteLine(a.IndexOf('i') + " " + a.IndexOf('e') + " " + a.LastIndexOf('i') + " " + a.LastIndexOf('e'));
    Console.ReadLine();
}

A. 0 6 7 8

B. 0 5 7 9

C. 5 9 0 7

D. 0 5 7 12

Answer: Option D


Join The Discussion

Related Questions on File Handling and Input Output in C Sharp