## Ten Primes on a Line

A natural number N (greater than one), is a prime number if it has no natural number divisors other than 1 and N. Given an integer M, write a program that finds the first M primes, printing them ten to a line. Each number should be separated by a space.

```5
```

### Sample Output

```2 3 5 7 11
```

Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 27, 2008

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

• (0/0)

• (0/1)
Is there an upper bound on M?

• (0/1)
Assume M < 10000.

• (0/1)
WAT

• (1/1)
Im printing ten to a line so what else am i doing wrong. PLEASE HELP!

• (1/1)
Your algorithm for finding primes is incorrect. With your current algorithm 33 is considered a prime(it's not).

• (0/1)
But when I run it through ideone.com, 33 doesn't print as a prime...

• (1/1)
Sorry it was late so I thoughy of the wrong number. Try 493(17*29).

• (0/1)
Ohh I see, it does print it thanks but I don't get how it's printing that

• (2/1)
As I mentioned before, your algorithm for determining primes is incorrect. Here's a useful link that should help you.
https://en.wikipedia.org/wiki/Primality_test

• (0/1)
Alright thanks

• (0/3)
i got the 1st test case right but not the 2nd and 3rd

• (3/0)
 printing them ten to a line