Swapping Two Numbers in C Language
Swapping Two Numbers in C Language
Introduction
Swapping values of two variables is a common task. This program demonstrates swapping using a temporary variable.
Explanation
-
temp = a;: Stores the value ofaintemp. -
a = b;: Assigns the value ofbtoa. -
b = temp;: Assigns the original value ofatob.
Comments
Post a Comment