Question: 1. Correct the mistakes in the following program by adding missing components. #include int main() { int a=2, b=1; } exchange (a, b); //exchange
1. Correct the mistakes in the following program by adding missing components. #include int main() { int a=2, b=1; } exchange (a, b); //exchange the values by address passing printf("a-8d, b-ad ", a, b); // a-1, b-2 void exchange (int a, int b) { // exchange the values of a and b point to int tmp; tmp = a; a = b; b = tmp;
Step by Step Solution
3.46 Rating (149 Votes )
There are 3 Steps involved in it
Corrected Code C include int main int a 2 b 1 exchangea b Pass addresses using pointers for value sw... View full answer
Get step-by-step solutions from verified subject matter experts
