Sponsored By
MindStick Cleaner
Advertise with Us
Advertisement
Advertise with Us
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
   

Home >> .Net >> C# >> How to understand the recursive call to itself
Author Post

aken H


Total Post: 66
Member Since: 9/6/2011
Points: 419
How to understand the recursive call to itself
Posted On: 11/3/2011 2:37:13 AM

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!

Author Post

Haider M Rizvi


Total Post: 40
Member Since: 6/6/2010
Points: 291
Re: How to understand the recursive call to itself
Posted On: 11/3/2011 5:49:25 AM

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

Author Post

aken H


Total Post: 66
Member Since: 9/6/2011
Points: 419
Re: How to understand the recursive call to itself
Posted On: 11/3/2011 9:04:56 AM

Hi Haider,

     sorry,i know,thanks for your help.

Report Abuse Form
Reason:    
 
Total Online Users: 2776
Advertisement
MindStick DataConverter
Advertise with Us
  
Copyright © 2009 - 2013MindStick. All Rights Reserved.