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
CODE:
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 =
6 – i;
i = 2;
swap(i, a,X);
printf(“%d%d%d%d%d%d”,i,a[0], a[1], a[2], a[3], a[4]);
}
What will be displayed in the screen after the following program executes, provided the formal parameter denoted with &
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am