C Programming
Input two nos and swap without using third variable.void main()
{
int a,b;
printf("Enter two nos.");
scanf("%d%d",&a,&b);
printf("Before Swaped value a=%db=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("Swaped value a=%db=%d",a,b);
getch();
}
Input: 10 20
Output Swaped value a=20 b=10
C Programming