Computing problem in writing program
<p>I'm trying to write a quick test program that would add two number inclusively, let say one interger is 2 and the other is 7, I want it to compute like this (2+3+4+5+6+7=27). Can't wrap my head around it. </p>

<p>Here is what I have</p>

<pre><code>public class Test
{
    public static void main (String[] args)
    {
        int lo=2;
        int hi=7;

        int result=0;

        for(int i=lo;i&lt;=hi;i++)
            result=i+i;

        System.out.println(result);
    }
}
</code></pre>
