Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 2nd, 2012  |  syntax: None  |  size: 0.39 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //looking to find N primes and print them
  2. public FindNPrimes(int numPrimes)
  3. {
  4.         //test numbers until we find numPrimes
  5.         //foreach 1,2,3, etc
  6.         {
  7.                 //test to see if it's not prime
  8.                 {
  9.                         //if we find that it's not prime, we don't need to test anymore and can go on to the next possiblePrime
  10.                 }
  11.                
  12.                 //since we didn't find that it's NOT prime,
  13.                 //it IS prime!
  14.                 {
  15.                         //print it
  16.                 }
  17.         }
  18. }