πŸ“Š C#
Q. What will be the output of the following C# code?
Code:
class Program
 {
     static void Main(string[] args)
     {
         int i ;
         for ( i = 0; i < 5; i++)
         {
             int j = 0;
             j += i; 
             Console. WriteLine(j);
         }
         Console. WriteLine(i);
         Console. ReadLine();
     }
 }
  • (A) 0, 1, 2, 3, 4, 5, 6
  • (B) 0, 1, 2, 3, 4, 5
  • (C) 0, 1, 2, 3, 4
  • (D) 0, 1, 2, 3
πŸ’¬ Discuss
βœ… Correct Answer: (B) 0, 1, 2, 3, 4, 5

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
179
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Babita
Publisher
πŸ“ˆ
90%
Success Rate