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.
Reputation Points: 1658
Solved Threads: 331
duckman
Offline 7,719 posts
since Nov 2004