Hi Guys,
I need your help on while statements.
Currently i have this:-
public class Numbers
{
public static void main(String[] args)
{
int x = Integer.parseInt(args[0]);
int y = Integer.parseInt(args[1]);
while ( x <= y)
{
System.out.println( x );
x = x + 1;
}
}
}
How do I modify the code above to include display of sum of the consecutive numbers? Thanks.
Regards,
John



Reply With Quote



Bookmarks