Thread: simple Recursion program - strange output

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338
    Code:
    void numbers(int one, int two) {
      printf( "%i\n", one );
      if ( one != two ) {
        if ( one > two ) {
          one--;
        } else if ( two > one ) {
          one++;
        };
        numbers(one,two);
      };
    };
    structure:
    Recursion (computer science) - Wikipedia
    Last edited by Structure; 09-13-2019 at 11:25 AM.
    "without goto we would be wtf'd"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program output is strange characters, totally baffled
    By chronograff in forum C Programming
    Replies: 4
    Last Post: 05-16-2017, 06:43 AM
  2. Whats wrong with simple recursion printing program?
    By tmac619619 in forum C Programming
    Replies: 6
    Last Post: 09-02-2015, 02:41 PM
  3. Replies: 1
    Last Post: 03-16-2015, 10:36 AM
  4. Help: Really strange output for simple calculation.
    By gpix13 in forum C Programming
    Replies: 4
    Last Post: 01-16-2010, 08:27 AM
  5. Very strange behavior from very simple program
    By somekid413 in forum C Programming
    Replies: 5
    Last Post: 12-17-2009, 08:53 PM

Tags for this Thread