/* C program to swap 2 numbers without using 3rd - TopicsExpress



          

/* C program to swap 2 numbers without using 3rd variable*/ #include #include void main() { int a,b; printf("Enter the values af a and b:-"); scanf("%d%d",&a,&b); printf("Value before swapping a=%d and b=%d",a,b); a=a+b; //calculate total value b=a-b; //deduct value of b from total value a=a-b; //deduct new value of b from total value printf("Value after swapping a=%d and b=%d",a,b); getch(); }
Posted on: Tue, 13 Aug 2013 02:43:09 +0000

Trending Topics



Recently Viewed Topics




© 2015