Consider this C code to swap two integers and these five statements: the cose
void swap(int *px,int *py){
*px=*px-*py;
*py=*px+*py;
*px=*py-*px;
}
statement 1: Will generate a compiler error
statement 2: May generate a segmentation fault in run time depending on the arguments passed
statement 3: Correctly implement the swap procedure for all input pointers referring to integers stored in memory locations accessible to the process
statement 4: implement the swap procedure for some but not all valid input
statement 5: May add or subtract integers and pointers
Which of the above statement is correct ?
(A) statement 1
(B) statement 2 & statement 3
(C) statement 2 & statement 4
(D) statement 2 & statement 5
I think only statement 3 is correct but it is not in option.