Computers and Technology

Consider the following program written in c syntax:

void swap (int a, int b) {

int temp;

temp = a;

a = b;

b = temp;

}

void main () {

int value = 2, list [5] = {1, 3, 5, 7, 9};

swap (value, list [0]);

swap (list[0], list[1]);

swap(value, list[value]);

for each of the following parameter-passing methods, what areall of the values of the variables value and list after each of thethree calls to swap?

a. passed by value

b. passed by reference

c. passed by value-result

2. consider the following program written in c syntax:

void fun (int first, int second) {

first += first;

second += second;

}

void main () {

int list [2] = {1, 3}

fun ( list[0], list [1]);

}

for each of the following parameter-passing methods, what areall of the values of the list array after execution?

a. passed by value

b. passed by reference

c. passed by value-result
me.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 22:00, rocksquad9125
Take a critical look at three gui applications you have used—for example, a spreadsheet, a word-processing program, and a game. describe how well each conforms to the gui design guidelines listed in this chapter.
Answers: 3
image
Computers and Technology, 23.06.2019 22:30, delawdermia27
The output voltage of a power supply is assumed to be normally distributed. sixteen observations are taken at random on voltage are as follows: 10.35, 9.30, 10.00, 9.96, 11.65, 12.00, 11.25, 9.58, 11.54, 9.95, 10.28, 8.37, 10.44, 9.25, 9.38, and 10.85
Answers: 1
image
Computers and Technology, 24.06.2019 17:30, sanchez9211
Click on the tab on the ribbon to open the backstage view. file view insert review
Answers: 1
image
Computers and Technology, 25.06.2019 00:00, bestdiva2
What function key is used to enable the spelling and grammar function
Answers: 1