main( )
{
int x = 20, y = 12 ;
swap ( x, y ) ;
printf ( "\nx = %d y = %d", x, y ) ;
}
swap ( int a, int b )
{
int z ;
z = a ;
a = b ;
b = z ;
printf ( "\na = %d b = %d", a, b ) ;
}


OUTPUT:


a = 12 b = 20
x = 20 y = 12



0 comments to "SWAPPING OF TWO NUMBERS IN C"

Post a Comment

Powered by Blogger.