Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.10 seconds.

  1. Re: Check if number is prime number or not problem[SOLVED]

    Stopping at n/2 is the natural next improvement to code that goes all the way to n. From there you can go the next step of stopping at square root of n, and from there you can do even smarter things!...
  2. Re: Check if number is prime number or not problem[SOLVED]

    You also only need to check up to n/2, where n is the number you're checking for prime-ness.
  3. Re: Check if number is prime number or not problemm

    When you say it didn't work, what exactly do you mean? What exactly does this program do? Hard code it into an SSCCE with some numbers that result in the broken behavior.

    Also, take a step back...
Results 1 to 3 of 3