For loop in Java

home-page-new Forums General Knowledge For loop in Java

Viewing 3 posts - 1 through 3 (of 3 total)
  • For loops can be used to loop through a sequence of numbers.

    For example:

    for(int i =0; i < 10; i ++) {

    System.out.println(i);

    }

    This prints out the numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

    Thank you Aakriti.

    Can you provide some more examples.

    Thank you Aakriti

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.