Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

listing prime numbers 1-100

807589Nov 23 2006 — edited Sep 4 2008
I'm making a program which outputs all prime numbers between one and a hundred, without just using System.out.println ("...") to show each one. I need to use for and loop until it hits 97, which is the last prime number before one hundred..
Does anybody know a formula I could run an int through to display all the primes, or any way i could do this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2008
Added on Nov 23 2006
111 comments
1,491 views