The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Java Code
Posted by: cday | June 23, 2009 @ 7:56pm
Java Code
[
Download
]
public class Prime { public static void main(String args[]) { int numPrimes = 0; int currentTest = 2; int isPrime = 1; while (numPrimes<10000) { for (int i = 2; i < currentTest-1; i++) { if (currentTest%i == 0){ isPrime = 0; break; } } if (isPrime == 1) { numPrimes = numPrimes + 1; System.out.println("found prime " + numPrimes + ": " + currentTest); } isPrime = 1; currentTest = currentTest + 1; } } }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.59 / 8
143 Votes
http://codebin.yi.org/311
page generated in 0.00 seconds