Friday, August 9, 2013

Java Program 002

Write a program DisplayNumbers.java, which accepts two int values as command line arguments (Start value and End value) and print the numbers between the given Numbers.


// Author J. Srivastav Reddy
// Date 30-7-2013

public class DisplayNumbers
{
public static void main(String[] args)
{
int start = Integer.parseInt(args[0]);
int stop = Integer.parseInt(args[1]);

for (; start < stop; start ++)
System.out.print(start + " ");
}
}