here the question it self has syntax error.swap (int x int y) is required.. in question swap(int x y) is given.If we correct the line and execute the pgm the values will not be swapped in main().so values will be x 2;y 3;
RE: For the following C program:swap(int x, int y){ int temp;temp=x;x=y;y=temp;}main(){int x=2;y=3;swap(x,y);}After calling swap, what are the values x & y?
here the value of x 2 and y 3...as in it does not change because here only the values are passed as arguments....for the values to get changed a referece to the variables has to be passes as an argument
RE: For the following C program:swap(int x, int y){ int temp;temp=x;x=y;y=temp;}main(){int x=2;y=3;swap(x,y);}After calling swap, what are the values x & y?
RE: For the following C program:swap(int x, int y){ int temp;temp=x;x=y;y=temp;}main(){int x=2;y=3;swap(x,y);}After calling swap, what are the values x & y?