What will be the output of the following C# code?

class Program { static void Main(string[] args) { int i ; for (i = 0; i < 5; i++) { Console.WriteLine(i); } Console.ReadLine(); } } a) 0, 1, 2, 3, 4, 5 b) 0, 1, 2, 3 c) 0, 1, 2, 3, 4 d) 0, 0, 0, 0, 0

What will be the output of the following C# code?

static void Main(string[] args) { string Name = “He is playing in a ground.”; char[] characters = Name.ToCharArray(); StringBuilder sb = new StringBuilder(); for (int i = Name.Length – 1; i >= 0; –i) { sb.Append(characters[i]); } Console.Write(sb.ToString()); Console.ReadLine(); } a) He is playing in a grou b) .ground a in playing is He c) … Read more

What will be the output of the following C# code?

static void Main(string[] args) { const int a = 5; const int b = 6; for (int i = 1; i <= 5; i++) { a = a * i; b = b * i; } Console.WriteLine(a); Console.WriteLine(b); Console.ReadLine(); } a) 600, 720 b) Compile time error c) 25, 30 d) 5, 6