Swapping of two number without third variable

Swapping of two number without third variable:-

Swapping of two number without third variable is the basic program of the 

c language program,it is the little bit tricky program here the code is below:-
#include<stdio.h>
void main()
{
      int a,b;
printf("Enter two number\n");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("The swapped values are a=%d and b=%d",a,b);
}

Swapping of two number without third variable:-

For the better understanding of the code and the concept of the program watch the following video:-
Previous
Next Post »