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 %Type,%Rowtype?
What are the compilers of JAVA and .NET Programming languages?
What Is The Difeerence Between C & C++
what is difference between restoring and non restoring division?
10.Define filters,binary to hexadecimal,hexadecimal to decimal?
What is the use of sas software? Is sas and sap are different?
Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik
In OB52 , How to define two open posting period, Like only 5 and 8 posting should be open.. should not open 6 and 7..period..
what is the difference between a namespace and assembly ?
What is the effect of the OPTIONS statement ERRORS=1?
3 Answers QSG, Quintiles, SAS,
I would like to know which institute in hyderabad provides best ms-dot net training along with a project. I want to join immediately. please help
what are all the validation we need to perform in data stage?