Recursive Functions - C++ Tutorial (Part 14)
Steve's teacher
Recursive functions are functions that calls themselves...
What happens in the example: fact(1) (returns 1, because of the if statement [if num == 1 return 1]) fact(1) also breaks the infinite loop, since it doesn't call fact()
2 * fact(1) (returns 2, since fact(1) returns 1; 2 * 1 = 2) 3 * fact(2) (returns 6, since fact(2) returns 2; 3 * 2 = 6) 4 * fact(3) (returns 24, since fact(3) returns 6; 4 * 6 = 24)
Subscribe for more videos! YouTube: https://www.youtube.com/stevesteacher?sub_confirmation=1 Odysee: https://odysee.com/$/invite/@stevesteacher:0
For more programming videos, feel free to subscribe to my 2nd channel: https://www.youtube.com/channel/UCZkCdex94Hp-3Aa-42kPhHg
Python Programming Tutorials: https://www.youtube.com/playlist?list=PLYBJzqz8zpWasL5mTe0t9W2cXrv7rnnsG C++ Programming Tutorials: https://youtube.com/playlist?list=PLYBJzqz8zpWZkX3y8sl8Fbi4mRze4SiPw Lua Programming Tutorials: https://youtube.com/playlist?list=PLYBJzqz8zpWavt37pA6NANJTGStIHpybU Become a Web Developer: https://youtube.com/playlist?list=PLYBJzqz8zpWbsmFurxBg2Pm-mlBmJdXbh HTML Tutorials: https://youtube.com/playlist?list=PLYBJzqz8zpWbQj-bLou8fOYgnDrrbKdAZ TKinter Tutorials: https://youtube.com/playlist?list=PLYBJzqz8zpWZwVkeu2E5Hjw5ImK7SzMe3 Linux Tutorials/Videos: https://youtube.com/playlist?list=PLYBJzqz8zpWYnUtUeVahkfIeYNKkLRMfZ Delphi Programming Tutorials: https://www.youtube.com/playlist?list=PLYBJzqz8zpWbKtfi2EiYTv4TeaWcR1I6k Web Scraping/Beautiful Soup Tutorials: https://youtube.com/playlist?list=PLYBJzqz8zpWYfL1pYs4FG8Ed0Cf3sookG Love2D Game Dev Tutorials: https://youtube.com/playlist?list=PLYBJzqz8zpWYip5ZkTMQiOkqya9Iiefm9 Godot Game Dev Tutorials: https://youtube.com/playlist?list=PLYBJzqz8zpWZT3jepx1vY1nwhaC-T8wB2 How-to videos: https://www.youtube.com/playlist?list=PLYBJzqz8zpWbp2DxyVGUCqxSZaCwDvU3C Crash Courses: https://www.youtube.com/playlist?list=PLYBJzqz8zpWbmPw2E0ywUEuhw6FEwVR0U MySQL Tutorials: https://youtube.com/playlist?list=PLYBJzqz8zpWaBcVuneV9g4zbKsmMCo-rR Japanese Lessons: https://www.youtube.com/playlist?list=PLYBJzqz8zpWYy-iJ0xckeOjCCE2roN9Ww
Group Chats: Weeb Chat: https://t.me/weeb_haven Programmer Haven: https://t.me/programmer_haven
You can contact me on: Email: StevesTeacherYT@gmail.com Discord: https://discord.gg/NGtD9s6 Kitsu: https://kitsu.io/users/Netsu Twitter: @stevesteacherYT or click here: https://twitter.com/stevesteacherYT?s=09
Hey there!!! Wanna help support the channel :D? You can donate on PayPal: https://paypal.me/stephenvdw?locale.x=en_US
Any suggestions? Leave it in the comment section or contact me somewhere else!
Odysee Links: Python Programming Tutorials: https://odysee.com/@stevesteacher:0/Python-Tutorials:5?r=7wEp27kZSg8dDKtQWMJam6CbMAizo9Vt C++ Programming Tutorials: https://odysee.com/@stevesteache ... https://www.youtube.com/watch?v=RjNI4p3-YcI
19861107 Bytes