/*
Summary: Swap two numbers without using third number.
*/#include<stdio.h>intmain(){
int a,b;
printf("Enter a and b");
scanf("%d",&a);
scanf("%d",&b);
printf("Before Swapping a=%d,b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("After Swapping a=%d,b=%d",a,b);
return0;
}
0 comments