Encoders
Hub for Computer Whizzes Register to join us

Encoders > More... > C > Program

/* Macro swap(t,x,y) that interchanges two arguments of type t. */

#include <stdio.h>

#define swap(t, x, y)	{ t _temp; _temp=x; x=y; y=_temp; }

main()
{
	int a=5, b=100;
	swap(int, a, b)
        printf("%d %d\n",a,b);
}