I would like to generate sequence number from 01 to 10. But I only want the odd ones. For example,
01 03 05 07 09
I tried this way.
for (int i = 1; i < 10; i++) { String sequence = String.format("%02d", i); System.out.println(sequence); //this prints out from 01,02,03.... to 09. So how should I change my code to omit the even ones in between?
i += 2in the loop?if(i%2==1)(the modulo operator)