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 + " ");
}
}
No comments:
Post a Comment