Harshad number (or Niven) is an integer that is divisible by the sum of its digits.

Ex: – 21, 111, 153.



  1. Take a number as input.
  2. Sum the digits of the number.
  3. Find the remainder of number/sum i.e number%sum
  4. If remainder is 0 then the input is Harshad number.
  5. Else Not.

Give your review below in the comment section.

Leave a Reply