A harshad number is an integer that is divisible by the sum of its digits. For example:
Write a console program that lets the user choose a number greater than 0. The program enumerates all numbers from the user-entered number down to 1. For each number, the program prints out whether it's a harshad number or not.
For example (user input in green):
Please enter a number greater than 0:
13
13 is not a harshad number.
12 is a harshad number.
11 is not a harshad number.
10 is a harshad number.
9 is a harshad number.
8 is a harshad number.
7 is a harshad number.
6 is a harshad number.
5 is a harshad number.
4 is a harshad number.
3 is a harshad number.
2 is a harshad number.
1 is a harshad number.
Reject any input that is not greater than 0. If the user enters a number smaller than 1, the program should print an error message and ask the user to try again. For example:
Please enter a number greater than 0: 0 0 is too small. Please try again: 1 1 is a harshad number.