solving program(2)

May 14, 2008 at 2:39pm
I need a help in these 2 questions:

1)write a program that prompts the user to input an integer and then outputs both the individuals digits of the number and the sum of the digits
ex.3456 output as 3 4 5 6, 400 as 4 0 0, -2765 as 2 7 6 5


2)write a function, reverseDigit, that takes an integer as a parameter and returns the number with its digits reversed
ex.the value of reverseDidit(2345) is 5432, (5600) is 65, (-258) is -852
May 14, 2008 at 7:04pm
What is your problem regarding those questions?
You have told us the requirements for your homework, but not given us any questions to answer to help you complete it. Note: We are not here to do your homework for you.
May 19, 2008 at 11:30am
You need a way to break up each digit of the given number.

Hint: 3000 = 3 * 1000, 400 = 4 * 100, etc.
Topic archived. No new replies allowed.