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 |
hi..this is kartheek..complted mca in 2009..but i dont have knowledge in programing..but to learn new language.. which one is suitable for me?is SAP or IBM mainframes is suitable for me..?if it suits how much will it costs..?pls answer...
Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k-dimension.
Hi Friends , i am very new in VB 6.0 Any body can able to help me ? i need interview question and answer vb 6.0 . please send honeysukumar@yhaoo.com
how can i create report in abap to insert data in table pa0002 using insert command
whats the Need for Concurrency control
In Java what is the difference between following two statements ? int a[],b; int []a,b;
why we use abstract in awt?
Please forward important interview and basic questions in VB6 on my email id: usneha_16@yahoo.co.in
Can i please VHDL code for D-Latch with clear input ?? (HINT: Set up a “Process” with appropriate sensitivity list to get the desired D-Latch with Clr working.) Inputs and Outputs: entity Lab4b is Port ( Clr, Clk, D : in STD_LOGIC; Q : out STD_LOGIC); end Lab4b;
what is software
what is encapulation?
how do we provide security for web services