/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package com.destiney.Prime; class Prime { { int x, y, c = 0; for( x = 2; x < 1000; x++ ) { if( x % 2 != 0 || x == 2 ) { for( y = 2; y <= x / 2; y++ ) { if( x % y == 0 ) { break; } } if( y > x / 2 ) { c++; } } } } }