subject

Starter Code: #include
void swapIncre(int*, int*, int*);
int main( ) {
int a, b, c;
// Input three integers
scanf("%d %d %d", &a, &b,&c);
while(a != -1) {
printf("Original inputs: a:%-4d b:%-4d c:%-4dn", a, b, c);
swapIncre(&a,&b,&c); //pass the reference to thevariable
printf("Rearranged inputs: a:%-4d b:%-4d c:%-4dnn", a, b, c);
//read again
scanf("%d %d %d", &a, &b,&c);
}
}
void swap(int *x, int*z){
}
void swapIncre(int *x, int *y, int *z){ //receive the referenceto variable as pointer
int temp = *x;
*x = *z;
*z = temp;
*y *= 2;
}
Modify program lab5A. c, by defining a new function void swap (...) which swaps the values of a and c. This function should be called in function swapIncre. Specifically, swap Incre ( ) only increases the value of b, and delegates the swapping task to swap ( ) . Show transcribed image text Modify program lab5A. c, by defining a new function void swap (...) which swaps the values of a and c. This function should be called in function swapIncre. Specifically, swap Incre ( ) only increases the value of b, and delegates the swapping task to swap ( ) .

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:30
In this lab, you complete a prewritten c program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. bonuses are calculated based on an employee’s productivity score as shown below. a productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
Which demographic challenge is europe currently experiencing? a. an aging and decreasing population b. a baby boomc. an unequal distribution between males and females d. a large group of teenagers moving through the school system(i chose a but i'm unsure)
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Rafael needs to add a title row to a table that he has inserted in word. what should he do? use the alignment options. use the merge and center option for all the cells in the top row. use the merge and center option on the first two cells in the top row. none of the above
Answers: 3
question
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
You know the right answer?
Starter Code: #include
void swapIncre(int*, int*, int*);
int main( ) {
int a, b,...
Questions
question
English, 06.09.2019 04:10
question
Geography, 06.09.2019 04:10
question
Mathematics, 06.09.2019 04:10
question
Mathematics, 06.09.2019 04:10
question
Mathematics, 06.09.2019 04:10
Questions on the website: 13722361