Interview Question

Interview Madison, WI

How will you swap the contents in two variables in C?


Interview Answer

1 Answer


first declare one temporary variable(temp) and copy the contents of the one of the variable(A) to the temp. Then copy the contents of the other variable(B) to A. Finally copy the contents of temp to B.

Interview Candidate on Oct 21, 2010

Add Answers or Comments

To comment on this, Sign In or Sign Up.