try your favourite search engine.
wikipedia also has an excellent article on prime numbers complete with explanations of the most popular algorithms.
None are particularly difficult to implement and I'm pretty sure your teacher wants you to do your own homework rather than submit something written by someone else.
You're there to learn something after all.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337