Hi,
I am working in this program that is suppoused to print the firsts numbers from a series of numbers:
1,5,9,13,17...etc..
So, the numbers are jumping from 4 to 4.
for example:
if the user enters "1",the program prints 1.
if the user enters "2", the program prints 1 and 5.
and so on.
but,
Right now, if the user enters, for example: "3", the program only prints: "1".
what can i do to solve this?
thanks for any response...
the code:
import java.io.*;
publicclass Tor{
publicstaticvoid main(String[]args)throws IOException{
BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
int inp;
System.out.println("Enter the number:");
inp=Integer.parseInt(br.readLine());
int i;
System.out.println("The numbers:");
for ( i=1; i<=inp; i+=4 ){
System.out.println(i);
}
}
}

