You are viewing a single comment's thread. Return to all comments →
@rtmrdnk I'm getting correct result by your code but not by below code in Java8, can you tell why?
for(int i=1;i<=n;sum+=(n%i++==0?i:0));
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 →
@rtmrdnk I'm getting correct result by your code but not by below code in Java8, can you tell why?
for(int i=1;i<=n;sum+=(n%i++==0?i:0));