|
Is it necessary to use strings for this assignment?
We have to prompt the user for two integers m and n, then compute and print the sum of the digits of integers m TO n. Example:
1985 1991
1985 - 23
1986 - 24
1987 - 25
1988 - 26
1989 - 27
1990 - 19
1991 - 20
Will it be necessary to convert the integers to string and then use the charAt() method? Is there a simpler way to do this?
Just looking for a hint, no solutions please. Thanks.
__________________
|