Swapping of two numbers in c without using third variable:
#include#include void main() { clrscr(); inta,b; printf("Enter two number which you want to swap : \n") ; scanf("%d%d",&a,&b); printf("\nBeforeswaping values a = %d\tb = %d\n",a,b); a=a+b; b=a-b; a=a-b; printf("After swaping new value :\n a = %d\tb = %d",a,b); getch(); }
No comments