Monday, November 1, 2010

swap two numbers without using temporary variable-C

#include
#include
void main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b); 
a = a+b;
  b = a-b;
  a = a-b;
printf("the swapped number is %d%d",a,b); 
getch();
}

No comments:

Post a Comment