Tuesday, July 28, 2009

I need help in trying to write out this function in C++?

Write a function with three formal integer arguments (one function input and two function outputs). The function will take the input and in a single do/while loop do the following: (1) get the sum of all digits, and (2) reverse the integer. Send both results back. (it should work for any length of an integer)


For example: For input 123 send back 6 and 321


For input 1874 send back 20 and 4781

I need help in trying to write out this function in C++?
A function can only have one return value. Either it was intended that one of the values be returned by reference, or you misinterpreted the assignment.

strawberry

No comments:

Post a Comment