KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have this piece of code, which is not working: BigInteger sum = BigInteger.valueOf(0); for(int i = 2; i < 5000; i++) { if (isPrim(i)) { sum.add(BigInteger.valueOf(i)); } } The sum variable is always 0. What am I doing wrong?
Tags (comma-separated)
Save Edits
Cancel