Swap two numbers means exchange the values of two variables with each other. For example variable num1 contains 20 and num2 contains 40 after swap there values num1 contains 40 and num2 contains 20.
Example: Suppose we have three glass A, B, Temp. Glass A contain 30, Glass B contain 50 and Glass Temp is empty now we want to interchange these two glass (A, B) valuse. So we follow below steps...
#include #include void main() { int a,b,c; clrscr(); printf("Enter value of a: "); scanf("%d",&a); printf("Enter value of b: "); scanf("%d",&b); c=a; a=b; b=c; printf("After swapping a=: %d b=: %d",a,b); getch();