+ 9
as we already know, the do while function is executed at least once. When the function is invoked in the variable z, it writes 1 + 1 and the variable x is incremented by ++x. z + = x + y = 2 + 2 + 1 = 5.
8th Jul 2019, 4:28 AM
Boboev Ahmadjon Safaralievich
Boboev Ahmadjon Safaralievich - avatar
+ 8
The first program is recursion. The function calls itself up to the base case which is m = 1. This is factorial. In function, you pass 4 as an argument. it works in that order. 4! = 4 * 3 * 2 * 1.
8th Jul 2019, 4:22 AM
Boboev Ahmadjon Safaralievich
Boboev Ahmadjon Safaralievich - avatar
+ 6
the first one simply returns the factorial of m --> 4! = 24
8th Jul 2019, 4:16 AM
Mind To Machine đŸ’»đŸ•†
Mind To Machine đŸ’»đŸ•† - avatar
+ 5
unlike a regular while loop a do while loop executes atleast once even if the condition in the while loop is false
8th Jul 2019, 4:40 AM
Mind To Machine đŸ’»đŸ•†
Mind To Machine đŸ’»đŸ•† - avatar
+ 4
Have you ever heard about recursion?
8th Jul 2019, 4:31 AM
Boboev Ahmadjon Safaralievich
Boboev Ahmadjon Safaralievich - avatar
+ 1
have you ever heard the term factorial?
8th Jul 2019, 4:20 AM
Mind To Machine đŸ’»đŸ•†
Mind To Machine đŸ’»đŸ•† - avatar