You are viewing a single comment's thread. Return to all comments →
put that i++ outside of if condition.
int sum=0; int i=1; while(i<=n) { if(n%i==0) { sum+=i; } i++; }
Day 19: Interfaces
You are viewing a single comment's thread. Return to all comments →
put that i++ outside of if condition.
int sum=0; int i=1; while(i<=n) { if(n%i==0) { sum+=i; } i++; }