parameter-passing
GATE CSE & IT · Instruction Set Architecture · 1989-2018
Study anchor
Morris Mano / Patterson-Hennessy
Digital logic, datapath, memory hierarchy, instruction sets
Practice action
Start latest PYQPYQs in this concept
All concepts →Consider the following C program: #include< stdio.h > void fun1(char *s1, char *s2){ char *tmp; tmp = s1; s1 = s2; s2 = tmp; } void fun2(char **s1, char **s2){ char *tmp; tmp = *s1...
What is the return value of f (p, p), if the value of p is initialized to 5 before the call? Note that the first parameter is passed by reference, whereas the second parameter is p...
What is printed by the following C program? #include < stdio.h > int f(int x, int *py, int **ppz) { int y, z; **ppz += 1; z = **ppz; *py += 2; y = *py; x += 3; return x + y + z; }...
The following program fragment is written in a programming language that allows global variables and does not allow nested declarations of functions. global int i = 100, j = 5; voi...
The following program fragment is written in a programming language that allows global variables and does not allow nested declarations of functions. global int i = 100, j = 5; voi...
The results returned by function under value-result and reference parameter passing conventions
Which is the most appropriate match for the items in the first column with the items in the second column? $$X.$$ Indirect Addressing $$Y.$$ Indexed Addressing $$Z.$$ Base Register...
What is printed by the print statements in the program P1 assuming call by reference parameter passing? Program P1() { x=10; y=3; func1(y,x,x); print x; print y; } func1(x,y,z) { y...
What is the result of the following program? program side-effect (input, output); var x, result: integer: fucntion f (var x:integer):integer; begin x:x+1;f:=x; end begin x:=5 resul...
What is the value of X printed by the following program? program COMPUTE (input, output); var X:integer; procedure FIND (X:real); begin X:=sqrt(X); end; begin X:=2 Find(X) Writeln(...
In which one of the following cases is it possible to obtain different results for call-by-reference and call-by-name parameter passing methods?
Indicate the following statement true or false: Although C does not support call by name parameter passing, the effect can be correctly simulated in C.
In which of the following cases it is possible to obtain different results for call-by-reference and call-by-name parameter passing?