Answers for "is self divisor java"

0

is self divisor java

a.
public static boolean isSelfDivisor(int number)
  {
    String s = String.valueOf(number);
    for (int i = 0; i < s.length(); i++)
    {
      int d = Integer.parseInt(s.substring(i, i+1));
      if (d == 0 || number % d != 0)
        return false;
    }
    return true;
  }
Posted by: Guest on May-04-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language