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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:30, morganwendel126
Use the keyword strategy to remember the meaning of the following word. the meaning for the word has been provided. write your keyword and describe the picture you would create in your mind. centurion: a commander in the army of ancient rome. keyword: picture:
Answers: 2
image
Computers and Technology, 22.06.2019 15:00, vladutraileanu7599
Which of the following has not been attributed at least in part to social media a. drug addiction b. depression c. kidnapping d. murder
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, lopez7512
What is the total resistance in a circuit that contains three 60 ohm resistors connected in a series? a. 20 ohms b. 120 ohms c. 60 ohms d. 180 ohms
Answers: 2
image
Computers and Technology, 23.06.2019 17:00, evanwall91
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
You know the right answer?
Starter Code: #include
void swapIncre(int*, int*, int*);
int main( ) {
int a, b,...

Questions in other subjects:

Konu
Mathematics, 25.02.2021 20:20
Konu
Mathematics, 25.02.2021 20:20