Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Buckys C++ Programming Tutorials - 31 - Recursion

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
18,430
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 9, 2011

For all of our videos, visit http://thenewboston.com

  • likes, 1 dislikes

Link to this comment:

Share to:

Top Comments

  • For an explaination of recurrsion see the bottom of this comment...

    For an explaination of recurrison see the top of this comment...

  • Wouldn't this be way easier just using a for loop?

see all

All Comments (127)

Sign In or Sign Up now to post a comment!
  • I learned how to do this in my brain before I knew what it was... sweet brag.

  • look at the call stack debug window and step through the code. that will help you see how the compiler interprets this code.

  • i try and explain this to you:

    factorial(5) returns 5*factorial(4)

    factorial(4) returns 4*factorial(3)

    factorial(3) returns 3*factorial(2)

    factorial(2) returns 2*factorial(1)

    factorial(1) returns 1

    and then it goes backwards to top like this 1*2*3*4*5 = 120 :) hope you understood this guys .

    p.s. thumbs up for Bucky :D

  • inception++?

  • INCEPTION: C++ Edition.

  • @ryangr0 ye but not half as sexy

  • @theubunny if you look at the first video of this tutorial series, you'll see this is Code::Blocks

  • What is this program name? Is it Dev C++?

  • factorialFinder(0);

  • Lets write it in other way:

    int fact(int x){ return (x<=1?1:x*fact(x-1));

    }

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more