See what questions your friends are asking today.

What is recursion explain with example?

View Slide Show

Close
Answer:
Recursion is when a function (procedure) calls itself.
Example:

int Fib (int n)
{
if ((n==1)||(n==0))return 1;
else return Fib(n-1) + Fib(n-2);
}

More on: .NET Programming

A .Net assembly is a self-contained package of code and/or resources. It contains a manifest that describes the contents of the... more »
C#.net ProgramsProgram # 1:This program takes three positive numbers from user. Compute and display the average of the two larger... more »

Top Questions

A partial class is a .NET feature that permits a class to be written across multiple...
.net is the URL suffix used to indicate a primary service provider or ISP. .com is for...
The events occur in the following sequence. Its best to turn on tracing(<% @Page...

Contributors

«
Hootershooter74
Trust: 176
  • Computers And The Net Supervisor
»

Top Contributors This Week

  • Trust Points: 2720
  • Member Since: 6/07
  • Trust Points: 2945
  • Member Since: 10/10
  • Trust Points: 2925
  • Member Since: 9/07
  • Trust Points: 7739
  • Member Since: 11/08
  • Trust Points: 708
  • Member Since: 1/11