You are viewing a single comment's thread. Return to all comments →
I like this one, it's clean and easy to follow.
Also, since it's a one liner for loop, you should be able to getaway with removing the curley braces.
for loop
for (int i = 1; i <= n; i++) if (n % i == 0) sum += i;
Seems like cookies are disabled on this browser, please enable them to open this website
Day 19: Interfaces
You are viewing a single comment's thread. Return to all comments →
I like this one, it's clean and easy to follow.
Also, since it's a one liner
for loop
, you should be able to getaway with removing the curley braces.