Question
Select the output for the following set of code:
static void Main(string[] args)Â {Â Â Â int i, s = 0;Â Â Â for (i = 1; i <= 10; s = s + i, i++);Â Â Â {Â Â Â Â Â Console.WriteLine(s);Â Â Â }Â Â Â Console.ReadLine();Â }
static void Main(string[] args)Â {Â Â Â int i, s = 0;Â Â Â for (i = 1; i <= 10; s = s + i, i++);Â Â Â {Â Â Â Â Â Console.WriteLine(s);Â Â Â }Â Â Â Console.ReadLine();Â }
Answer: Option D
Was this answer helpful ?
Since occurrence of termination symbol(;) at end of for loop.
Output: 55.
Was this answer helpful ?
More Questions on This Topic :
Question 2. Correct syntax for do while loop is : ....
Submit Solution