Swapping of two numbers in c without temporary variable
C Program:
Output 1:
From the above program,
ü Let a=5 and b=6.
ü Here add and sub operations used to swap the variables.
ü a=a+b;(a=5+6=11)(a=11)
b=a-b;(b=11-6=5)(b=5)
a=a-b;(a=11-5=6)(a=6).
ü Finally, a=6 and b=5.
0 Comments