Correct option is A
The f1 function attempts to swap values locally within its scope, having no effect on a and b. However, f2 swaps the pointers by dereferencing them, effectively changing the values of a and b in main().
· First printf: f1 has no effect, so output remains as ONE TWO.
· Second printf: f2 swaps the values to TWO ONE.
Information Booster:
· Pointer Functions: Demonstrates pass-by-value vs. pointer dereferencing.
· Local Swap Limitation: f1 only affects local copies, not original pointers.
· First printf: f1 has no effect, so output remains as ONE TWO.
· Second printf: f2 swaps the values to TWO ONE.
Information Booster:
· Pointer Functions: Demonstrates pass-by-value vs. pointer dereferencing.
· Local Swap Limitation: f1 only affects local copies, not original pointers.