Question: 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 !=

 Starter Code: #include void swapIncre(int*, int*, int*); int main( ) {

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:%-4d ", a, b,c); swapIncre(&a,&b,&c); //pass the reference to the variable printf("Rearranged inputs: a:%-4d b:%-4d c:%-4d ", 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 reference to 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 ( )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!