Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Explain recursion with an example.



Explain recursion with an example...

Answer / nashiinformaticssolutions

o Recursion is a technique where a function calls itself to solve smaller sub-problems.
8. def factorial(n):
9. if n == 1:
10. return 1
11. else:
12. return n * factorial(n - 1)
13. print(factorial(5)) # Output: 120

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)

0 Answers   Amazon,


How should a programmer decide whether to use a macro or a subroutine to accomplish a given logical function

1 Answers   R V College of Engineering, University of Jordan,


why you have to became a software developer?

2 Answers  


shall we execute our java programmes in jre

0 Answers  


Crystal report proffessional 9 to filter the issue date!!

1 Answers  


How to print a name "ARCHANA" in any programming language

6 Answers   Value Labs,


can u send some model papers how computer awareness questions are asked in goverment jobs(oriental insurance)to my mail id me.priyankapadma@rediff.com

0 Answers  


What is the difference between windows 98/2000/XP Operating Systems?

16 Answers   CMS, Siemens, TCS,


is it possible to learn sap from book without any tutorial. if yes please mention the beginner,s book of sap and also make your valuable advice for self study of sap .

0 Answers  


Which method protects back button to retrieve old value from previous page in Struts.

0 Answers  


what is difference between java and c#

2 Answers   Cyient,


without selecting individually each field in Action Class from jsp,what is the best process to select as many as field at a time automatically from jsp page by using value object class.

0 Answers  


Categories