C program To Swap Two Numbers Without Third Variable

      No Comments on C program To Swap Two Numbers Without Third Variable
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
 int a=10,b=5;
printf(" Value of a before swaping %d",a);
printf("\n Value of b before swaping %d",b);
a=a+b;
b=a-b;
a=a-b;
printf("\n Value of a after swaping %d",a);
printf("\n Value of b after swaping %d",b);
getch();
}

OUTPUT:-

scanfcode

Leave a Reply

Your email address will not be published. Required fields are marked *