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

what is the difference between java , sap ,.net , orecle apps ?

1 Answers  


To sorting array of 10 elements which sorting is best a)selection b)bubble c)tree sort

2 Answers   HP, Hughes,


Write a shell program to test whether a given year is leap year or not ?

0 Answers   Patni,


ho&#65367;&#12288;&#65364;o check single or double byte in struts

0 Answers  


Hello Experts, What is the difference between move and move corresponding exactly? please post me asap

0 Answers  


Expand the following a) ISDN b) CASE c) CSMA/CD d) OOPS e) MIMD

4 Answers   CTS,


what is the difference between read the data from table and infotype

0 Answers  


how can we get version of database ?

1 Answers  


through which algorithm does the garbage collector works? how the garbage collector will understand that the object will going to be deleted?

0 Answers   Motorola,


Tag for turning an image into a hyperlink is

0 Answers  


How to change the color of a cell or a row in a datagrid on mouse hover using javascript/.net

0 Answers   Tesco, Wipro,


How Many versions are there in crystal reports

2 Answers   Wipro,


Categories