a recoursive function problem!!!

This is a discussion on a recoursive function problem!!! within the C++ Programming forums, part of the General Programming Boards category; i need to write a recoursive function that gets an integer and returns it reversed!!! is it possible????? here is ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    3

    Unhappy a recoursive function problem!!!

    i need to write a recoursive function that gets an integer and returns it reversed!!!
    is it possible?????
    here is my lousy try!! please help me!! its 4 my university and i cant find a way.
    thanks in advance.
    eyal.

    --------------START-----------------------------------
    int revnum(int num)
    {
    if (num/10==0)
    return num%10;
    else
    return 10*(num%10)+revnum(num/10,dbl);
    }
    --------------FINISH----------------------------------

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    3

    reply to the question

    its quite easy!!!
    just add the following line......
    num%10*10=revnum(num);
    num%10*10=revnum(num);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. wxWidgets link problem
    By cboard_member in forum C++ Programming
    Replies: 2
    Last Post: 02-11-2006, 02:36 PM
  2. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  3. Replies: 5
    Last Post: 02-08-2003, 07:42 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 06:06 PM
  5. qt help
    By Unregistered in forum Linux Programming
    Replies: 1
    Last Post: 04-20-2002, 10:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21