Vidyalelo
C# Programming · Q91

Control Flow Statements in C Sharp

Programming · C# Programming · question 91

Q91

What will be the output of the following C# code? static void Main(string[] args) int i, s = 0; for (i = 1; i <= 10; s = s + i, i++); Console.WriteLine(s); Console.ReadLine();

A.
Code report error
B.
Code runs in infinite loop condition
C.
Code gives output as 0 1 3 6 10 15 21 28 36 45
D.
Code give output as 55
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board