Advertisements
Advertisements
प्रश्न
Which of the following is a normal function definition and which is a recursive function definition.
let disp :
print ‘welcome’
उत्तर
Normal function
APPEARS IN
संबंधित प्रश्न
The small sections of code that are used to perform a particular task are called ______
Which of the following is a unit of code that is often defined within a greater code structure?
Which of the following defines what an object can do?
What is a subroutine?
Which of the following is a normal function definition and which is a recursive function definition.
let rec sum x y:
return x + y
Which of the following is a normal function definition and which is a recursive function definition.
let rec sum num:
if (num!=0) then return num + sum (num-1)
else
return num
What happens if you modify a variable outside the function? Give an example.
Identify in the following program.
let rec gcd a b:=
if b <> 0 then gcd b (a mod b) else return a
Name of the function?
Identify in the following program.
let rec gcd a b:=
if b <> 0 then gcd b (a mod b) else return a
A statement that invokes the function recursively?
Identify in the following program.
let rec gcd a b:=
if b <> 0 then gcd b (a mod b) else return a
The statement which terminates the recursion?