---
title: "How to understand the recursive call to itself"  
description: "How to understand the recursive call to itself"  
author: "Kenny Tangnde"  
published: 2011-11-03  
updated: 2011-11-03  
canonical: https://www.mindstick.com/forum/347/how-to-understand-the-recursive-call-to-itself  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How to understand the recursive call to itself

Hi all,

such as:

```
Public Function Factorial(N As Integer) As Integer
    If N <= 1 Then
        Factorial = 1
    Else
        Factorial = Factorial(N - 1) * N
    End If
End Function
Sub res()
   Debug.Print Factorial(4)
End Sub
```

Its principle is to perform what,why the [output](https://www.mindstick.com/interview/34427/explain-the-output-in-angular) is 24.

thanks!

## Replies

### Reply by Kenny Tangnde

Hi Haider,

sorry,i know,thanks for your help.

### Reply by Anonymous User

Hi Aken,

This is not a class room where you will get the code explained.

Here, you can discuss your problem you are getting in your project or if you are stuck somewhere in your code. By this way experts here stop looking at your problem and you won't get your problem solved.

So, please ask only relavent questions.

By the way, the above code is calculating the factorial of 4.

i.e. 4*3*2*1

Google for detailed information about Recursion.

Hope you will understand and won't repeat your mistakes again.

Thanks


---

Original Source: https://www.mindstick.com/forum/347/how-to-understand-the-recursive-call-to-itself

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
