I am trying to assign a value to a long variable but eclipse shows compile error. Can anyone work it out what is wrong with this? I have check and am assured that the value is in long’s range.
public static void main(String[] args) {
**long num = 600851475143;**
for(long i = num/2; i<1; i--) {
if(num%i == 0 && isPrime(i) == true) {
System.out.println(i);
break;
}
}
}
add
Land make itAlso See