What will be displayed in the screen after the following program executes, provided the formal parameter denoted
Fantastic news! We've Found the answer you've been seeking!
Question:
What will be displayed in the screen after the following program executes, provided the formal parameter denoted with & will be transferred by:
a. value
b.value/result
c. reference
d. name
int a[5];
int i,X=1;
void swap (int&a, int&b,int&c)
int t;
{
c++;
t = a+X+c; a = b; b = t;
}
void main()
{
for (i=0;i<5;i++) a[i] = 6 – i;
i = 2;
swap(i, a[i],X);
printf(“%d%d%d%d%d%d”,i,a[0], a[1], a[2], a[3], a[4]);
}
Related Book For
Posted Date: