CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

For Loop Sum 1 to 5

C# code walkthrough · Question 6
easyLoops

Code

Read carefully. What does this print?
1int sum = 0;
2for (int i = 1; i <= 5; i++)
3{
4 sum += i;
5}
6Console.WriteLine(sum);

Your answer