Give the output of the following program (written in C syntax) using each of the four parameter
Fantastic news! We've Found the answer you've been seeking!
Question:
Give the output of the following program (written in C syntax) using each of the four parameter passing methods:
(a) pass by value
(b) pass by reference
(c) pass by value-result
(d) pass by name
int i;
int a[2];
void functionp(int x, int y)
{
x ++;
i++;
y++
}
int main()
{
a[0] = 1;
a[1] = 1;
i = 0;
functionp(a[i], a[i]);
printf("%d\n", a[0]);
printf("%d\n", a[1]);
return 0;
}
Related Book For
Data Structures and Algorithms in Java
ISBN: 978-1118771334
6th edition
Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Posted Date: