Font size
WorksheetsTN +2 -LESSON1 FUNCTIONS
Total questions: 20
Worksheet time: 13mins
The values which are passed to a function definition are called
(a) Subroutines
(b) Arguments
(c) Function
(d) Definition
The small sections of code that are used to perform a particular task is called
(A) Pseudo code
(B) Subroutines
(C) Modules
(D) Files
Which of the following are mandatory to write the type annotations in the function
definition?
(a) < >
(b) ( )
(c) { }
(d) [ ]
Which of the following carries out the instructions defined in the interface?
(a) Compiler
(b) Operating System
(c) Implementation
(d) Interpreter
The functions which will give exact result when same arguments are passed are called
(A) Impure functions
B) Partial Functions
(C) Dynamic Functions
(D) Pure functions
The functions which cause side effects to the arguments passed are called
(A) impure function
(B) Partial Functions
(C) Dynamic Functions
(D) Pure functions
Which of the following defines what an object can do?
(A) Operating System
(B) Compiler
C) Interface
(D) Interpreter
The variables in a function definition are called as
(A) Subroutines
(B) Function
(C) Definition
(D) Parameters
Which of the following is a normal function definition and which is recursive function
definition
i) let sum x y:
return x + y
ii) let disp :
print ‘welcome’
iii) let rec sum num:
if (num!=0) then return num + sum (num-1)
else
return num
i) normal function definition
ii) recursive function
iii) recursive function
i) normal function definition
ii) normal function
iii) recursive function
i) recursive function definition
ii) recursive function
iii) recursive function
i) normal function definition
ii) normal function
iii) normal function
A function definition which call itself is called
Recursive function
Lambda function
parametrized function
non-parameterized function
In Programming languages,
subroutines are called as
Constructors
Iteration
loop
Functions.
___ are expressed using statements of a programming language
Instruction
Algorithms
strlen() is a ____ function
Pure
Impure
Read the following specification carefully
let rec gcd a b:=
if b<>0 then gcd b (a mod b)
else return a
Answer the question: Identify Name of the function
(a)
Read the following specification carefully
let rec gcd a b:=
if b<>0 then gcd b (a mod b)
else return a
Identify the statement which tells it is a recursive function
(a)
Read the following specification carefully
let rec gcd a b:=
if b<>0 then gcd b (a mod b)
else return a
Statement which terminates the recursion.
(a)
Read the following specification carefully
let rec gcd a b:=
if b<>0 then gcd b (a mod b)
else return a
Identify the parameters .
a
b
a,b
gcd
Choose the pure function from the options given below
random( )
date( )
time( )
sin( )
The keyword ___ is used to refer a recursive function in the program code
let
rec
def
function
____ just defines what an object can do, but won't actually do it
interface
implementation
definition
code
