using System; public class Program{ public static void Main() { int sum; for (int i = 0; i <= 1000; i++) { if (i % 3 == 0 || i % 5 == 0) { sum += i; } } Console.WriteLine(sum); }}
Standard input is empty
prog.cs(11,5): error CS0165: Use of unassigned local variable `sum' prog.cs(15,21): error CS0165: Use of unassigned local variable `sum' Compilation failed: 2 error(s), 0 warnings
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!