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 difference between kpo and it industry? that is in terms of work, package etc
define profiler???
how many logical drive we can form to physical device in our computer?
what is difference between input parameter and output parameter.
Even if all fields are initialized also in a program, I am getting COBOL/400 decimal data error .why is it coming?
Why data bus is bidirectional and address bus is unidirectional?
What is the difference between DECISION COVERAGE(DC) and MODIFIED CONDITION/DECISION COVERAGE(MCDC)?
why we use abstract word in abstract window toolkit in java language.
How to call dll API sub routine in VB Form.
I would like to know what is Intellimatch and some interview questions which could be asked related to Intellimatch.
Write a shell program to test whether a given year is leap year or not ?
Explain the types of operations? Draw the figure for shift and rotate operations?