HOW TO UNDERSTAND THE RECURSIVE CALL TO ITSELF

Kenny Tangnde

Total Post:68

Points:476
Posted by  Kenny Tangnde
C# 
C#
 1542  View(s)
Ratings:
Rate this:

Hi all,

   such as:

Public Function Factorial(As IntegerAs Integer
    If N <= 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 is 24.

thanks!

  1. Alex R

    Post:40

    Points:280
    Re: How to understand the recursive call to itself

    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

  1. Kenny Tangnde

    Post:68

    Points:476
    Re: How to understand the recursive call to itself

    Hi Haider,

         sorry,i know,thanks for your help.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!