Code: Select all
public void sum(int a, int b)
{
int first = a
int last = b
int total = 0
while (first<=last)
{
total = total + first;
first = first + 1
}
System.out.println(total);
}
Code: Select all
public void sum(int a, int b)
{
int first = a
int last = b
int total = 0
while (first<=last)
{
total = total + first;
first = first + 1
}
System.out.println(total);
}

ofy1993 wrote:

