Saturday, May 12, 2012

Interchange the values of Two Integers

Hello Friends!!! How are you? Hope, you all are well by the grace of Almighty. Today we learn how to interchange two integer numbers.

Problem: Write a program to interchange the value of two variables, say x and y.


Solve:






















In this code, to interchange the values of x and y, a temporary variable called "t" has been declared. Then, scan the values of x and y. After that, the value of x is assigned in t, the value of y is assigned in x and the value of t is assigned in y. Thus we interchange the values of x and y.

Thank you all..:)

0 comments:

Post a Comment