Recursion

About recursion. We have seen about functions in previous post is. So what happens if the function calls itself? This is called a recursive function. For example int sum(int a, int b) { return sum(a, b); } Let’s look at the function. sum takes 2 variables and returns an int value. But what will happen if he called himself inside? Of course it will run indefinitely and I certainly don’t want that....

March 3, 2023 · 2 min · 394 words · Me