Printing prime number from 1 to 100
<p>This program is supposed to output the prime numbers between 1 and 100. 
Will anyone please explain me the flow the programme below? I am having difficulty in writing the programme below. I did find it on the internet but still I can't figure out how it works and how the flow of the programme will be?</p>

<pre><code>public class GeneratePrimeNumbersExample {

    public static void main(String[] args) {

            //define limit
            int limit = 100;

            System.out.println("Prime numbers between 1 and " + limit);

            //loop through the numbers one by one
            for(int i=1; i &lt; 100; i++){

                    boolean isPrime = true;

                    //check to see if the number is prime
                    for(int j=2; j &lt; i ; j++){

                            if(i % j == 0){
                                    isPrime = false;
                                    break;
                            }
                    }
                    // print the number
                    if(isPrime)
                            System.out.print(i + " ");
            }
    }
}
</code></pre>

<p>Output of Prime Numbers example would be
Prime numbers between 1 and 100</p>

<p>1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97</p>