i need a simple program, i think using for loop, to find odd numbers till a specified number using command line argument. like i want to find out all odd numbers till 10.
class Odd
{
public static void main(String args[])
{
int i=Integer.parseInt(args[0]);
for(int count=1;count<=i;count+=2)
{
System.out.println(count);
}
}
}
java Odd 9
1
3
5
7
9