java - What does this section of code do -


Can anyone explain what this code is and what is this doing? Thanks!

 for  (int i = 2; i & lt; = max; i ++) {counter = 0; (For int n = 2; n & lt; i; n ++) {if (i% n == 0) {counter ++; }} If (counter == 0) {System.out.println (i); }}  

Principal numbers between 2 and maximum of its printing

< P> This works as below:

  starts with 2 with me and checks every time every step that is less than every element (so if I am 5, check with 2,3,4) which is divided by number I and if this counter increases. If counter 0 is, print that number  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -