previous | start | next

Avoid This Error!

What is the output of the following:

 int sum = 0;
 int i;

 for(i = 1; i <= 10; i++);
     sum += i;

 System.out.println("sum = " + sum);


previous | start | next