Parameter passing
Gapfill exercise
Enter your answers in the gaps. When you have entered all the answers, click on the "Check" button.
What are the parameter passing methods?
The mechanism used to pass
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
to a procedure (subroutine) or function. The most common methods are to
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
the value of the actual parameter (
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
by value), or to pass the
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
of the
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
location where the actual parameter is stored (call by
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
).
What is call by value method?
In the call by value method the
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
arguments are copied to the
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
arguments, hence any
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
performed by function on
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
doesn’t affect actual parameters.
What is call by reference method?
Unlike call by value, in this method,
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
of actual arguments (or parameters) is
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
to the
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
parameters, which means any
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
performed on formal
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
affects the value of
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
parameters.
what are the different aspects of function calling?
A function may or may not accept any argument. It may or may not return any value. Based on these facts, There are four different aspects of function calls.
function
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
arguments and
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
return
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
function without
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
and with return value
function
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
arguments and without return value
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
with arguments and
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
return value
find the missing terms?
#include
int sum();
void
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
()
{
int
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
;
printf("\nGoing to calculate the sum of two numbers:");
result = sum();
printf("%d",result);
}
int
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
()
{
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
a,b;
printf("\nEnter two numbers");
scanf("%d %d",&a,&b);
actual
address
arguments
call
formal
function
int
main
memory
operation
parameters
pass
passed
reference
result
return
sum
value
with
without
a+b;
}
Check
OK