From 82ff627738706c513de54443c3b528fed0c66612 Mon Sep 17 00:00:00 2001 From: Gourav Date: Wed, 27 Mar 2019 06:46:37 +0530 Subject: [PATCH] Add recursive function definition and example (#30714) --- guide/english/cplusplus/functions/index.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/guide/english/cplusplus/functions/index.md b/guide/english/cplusplus/functions/index.md index d623a9322b..f2b4ba3a7d 100644 --- a/guide/english/cplusplus/functions/index.md +++ b/guide/english/cplusplus/functions/index.md @@ -128,6 +128,23 @@ int val = test(); ``` +## Recursive Function + +When the function calls itself then it is known as recursive function. + +Example: + +```cpp +void printNumbersUptoN(int n) +{ + if(n == 0) + return; + + printNumbersUptoN(n - 1); + cout<