Recent questions tagged parameter-passing

29 votes
7 answers
35
2 votes
1 answer
38
P(X:integer,Y:integer) { X = 6; A = 8; return ( X + Y ) }if the function P were invoked by the following program fragment. k = 1; L = 1; Z = (K, L);Then the value of Z wo...
0 votes
1 answer
40
void main() { int x=10, y=5; swap(x,y); print(x,y); } void swap(int a, int b) { int c, x=0; c=a; a=b; b=c; }what is output using call by text?a) 5 0b) 5 10c) 10 0d) ...
1 votes
4 answers
41
int i = 1; int main() { int a[]= { 0,1, 2} ; f(a[i], i); printf("%d", a[i]); } void f(int x, int y) { y++; x=5*i; }In above function f() uses " call by name" technique, w...
0 votes
1 answer
42
What will be the second value printed by the program if parameter passing mechanism is call by reference?int b=10 //global begin procedure func(int x,int y) begin print(b...
37 votes
3 answers
50
What does the following program print?#include<stdio.h void f(int *p, int *q) { p=q; *p=2; } int i=0, j=1; int main() { f(&i, &j); printf("%d %d\n", i,j); return 0; }$2 \...
13 votes
1 answer
52
13 votes
2 answers
55