Results 1 to 13 of 13

Thread: Anyone know a algorithm to reverse a number's order?.:Resovled:.

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member voidflux's Avatar
    Join Date
    Jun 2003
    Location
    Brockway, PA
    Posts
    290

    Question Anyone know a algorithm to reverse a number's order?.:Resovled:.

    Hello everyone,
    I'm trying to figure out how i'm suppose to ouput a number reversed, such as, 123 output it as 321.
    I'm not allowed to use arrays so i'm thinking there has to be a mathamatical way of doing this. There is no fixed amount of numbers, it can be 2 to whatever the user wants to enter, any idea's? Like this almost worked....
    input: 155
    155%10 = 5;
    15%10 = 5;
    10%10 = 0;
    almost got 551

    % is mod in C++ but u all probably knew that just making sure!
    Thanks for listening
    Last edited by voidflux; Aug 17th, 2003 at 12:40 PM.
    C¤ry Sanchez
    Computer Science/Engineering
    @ Penn State
    IBM.zSeries Intern
    Mandriva 2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width