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.

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

1 Expert Approved Answer
Step: 1 Unlock

Corrected Code C include int main int a 2 b 1 exchangea b Pass addresses using pointers for value sw... View full answer

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 Operating System Questions!