+ 7

Greetings, Sololearners! Welcome to another challenge! A Harshad Number is a number that is divisible by the sum of its digits. For example, 18 is a Harshad number as its digital root is 1+8 = 9, and as 18 % 9 == 0, it is a Harshad number. Your task: Write a program that identifies if a number is a Harshad number. If it is Harshad, return True. If not, return the next Harshad number. Example 1: 1 Output: True Example 2: 24 Output: True Example 3: 73 Output: 80 Good luck, and have fun!

14th Oct 2017, 9:21 AM
blackcat1111
+ 15
14th Oct 2017, 12:14 PM
Krishna Teja Yeluripati
15th Oct 2017, 4:43 AM
Amit Dubey
15th Oct 2017, 4:53 PM
Infinity
+ 4
https://code.sololearn.com/cbM6fLLVsCgN/?ref=app
25th Oct 2017, 1:54 PM
Saransh Bhatia
+ 3
a=int(input()) sum=0 for i in str(a):sum+=int(i) print(a%sum==0) #python
14th Oct 2017, 3:07 PM
π Prometheus πΈπ¬
+ 2
My try in python. Do feel free to comment on how I can improve my code to make it simpler and neater! :) I'm quite new to coding :) https://code.sololearn.com/cM1BY2UL26mW/?ref=app
15th Oct 2017, 7:40 AM
Magg
15th Oct 2017, 11:22 AM
Saurabh Tiwari
30th Oct 2017, 11:35 AM
Pranit Gandhi
2nd Jan 2019, 4:28 PM
Azeddine Hamdaoui
+ 1
https://code.sololearn.com/ccThPC5yHfXu/#cs
30th Oct 2017, 3:27 PM
Veres Roland