C program for
C Program:
Output 1:
From the above program,
ü Let a=7 and b=5.
ü Let c be the third variable used for swapping the numbers.
c=a |
a=b |
b=c |
c=7 |
a=5 |
b=7 |
ü a's value will be first assigned to the variable c, then b's value assigned to the a variable, now b's value overwrites the a's value.
ü now b's value will be overwritten by the c's value which is actually the a's value.
0 Comments