Blog Archive

Sunday, August 29, 2010

Swap the values of two numbers without using third variable

/*
Swap the values of two numbers without using third variable
*/
#include<stdio.h>

void main()
{
int a=5,b=10;
a = a+b;
b=a-b;
a=a-b;
printf("a = %d, b = %d",a,b);
}

No comments:

Post a Comment