Print all 0

0

I declare the following variable:

int sequencia = 000000000;

At the time of printing, you are only printing a 0.

Does anyone know how I can print all 0 (zeros)?

How do I auto-increment to the point that every time I change the value to: 000000001,000000002 until I get 999999999?

    
asked by anonymous 01.02.2018 / 15:19

1 answer

3
for (int i = 0; i <= 999999999; i++) {
    System.out.println(String.format("%09d", i));
}

See the example above working in IDEONE

    
01.02.2018 / 15:43