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 |
what is the difference between java , sap ,.net , orecle apps ?
To sorting array of 10 elements which sorting is best a)selection b)bubble c)tree sort
Write a shell program to test whether a given year is leap year or not ?
how to check single or double byte in struts
Hello Experts, What is the difference between move and move corresponding exactly? please post me asap
Expand the following a) ISDN b) CASE c) CSMA/CD d) OOPS e) MIMD
what is the difference between read the data from table and infotype
how can we get version of database ?
through which algorithm does the garbage collector works? how the garbage collector will understand that the object will going to be deleted?
Tag for turning an image into a hyperlink is
How to change the color of a cell or a row in a datagrid on mouse hover using javascript/.net
How Many versions are there in crystal reports