Question
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 ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Industrial Relations in Canada
Authors: Fiona McQuarrie
4th Edition
978-1-118-8783, 1118878396, 9781119050599 , 978-1118878392
Students also viewed these Computer Network questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App