You are viewing a single comment's thread. Return to all comments →
static int divisibleNumbers(int n) { /* * Write your code here. */ int a; for (int i = n; ; i += n) { int sum = 0, product = 1, q = i, count = 0; boolean flag = true; while (q > 0) { int rem = q % 10; if (rem == 0) { flag = false; break; } sum += rem; product *= rem; count++; q /= 10; } if (flag) { if (sum >= product) { a = count; break; } else continue; } continue; } return a; }
I'm really not getting what to do about this???
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Numbers
You are viewing a single comment's thread. Return to all comments →
I'm really not getting what to do about this???