program logic of printing the prime numbers

前端 未结 7 565
别那么骄傲
别那么骄傲 2021-01-25 22:15

Can any body help to understand this java program?

It just prints prime numbers, as you enter how many you want and it works well.

class PrimeNumbers
{           


        
相关标签:
7条回答
  • 2021-01-25 22:36

    If I'm right there is a theory in math, saying that nearly all prime numbers can be determined when checking numbers from 2 to square root of n instead of checking all numbers from 2 to n oder 2 to n/2.

    0 讨论(0)
提交回复
热议问题