Computing problem in writing program
Hey guys, 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+7+7=27). Cant wrap my head around it. Here is what i have

public class test
{
	public static void main (String[] args)
	{
	
	int lo=2;
	int hi=7;
	
	int result=0;
	
	for(int i=lo;i<=hi;i++)
	
	result=i+i;
		
	System.out.println(result);
	
	}
}
Computing problem in writing program
===

Hey guys, 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+7+7=27). Cant wrap my head around it. Here is what i have

public class test
{
	public static void main (String[] args)
	{
	
	int lo=2;
	int hi=7;
	
	int result=0;
	
	for(int i=lo;i<=hi;i++)
	
	result=i+i;
		
	System.out.println(result);
	
	}
}