Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What will be displayed in the screen after the following program executes, provided the formal parameter denoted with & will be transferred by: a.

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]);

}

Step by Step Solution

3.38 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

Answer The code int a5 int i X 1 void swapint a int b int c c int t a X c a b b t void main for i ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Industrial Relations in Canada

Authors: Fiona McQuarrie

4th Edition

978-1-118-8783, 1118878396, 9781119050599 , 978-1118878392

More Books

Students also viewed these Computer Network questions

Question

Why is the zone of agreement important in negotiations?

Answered: 1 week ago