void change(int a, intb) {
a=a+2;
b = a*3+1;
}
void main() {
list[5] = {2,4,6,8,10};
change(list[2], list[0]);
change(list[1], list[3]);
}
For each of the following parameter-passing methods,what are all of the values of thevariables value and list after each of the twocalls to change in the main function?
void change(int a, int b) { a=a+2; b = a*3+1; } void main() { list[5] = {2,4,6,8,10}; change(list[2], list[0]); change(l
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am