Swapping of two numbers without arithmatic operator without temporary variable

#include<stdio.h>
void swap(int *a,int *b)
{
     *a^=*b^=*a^=*b;
 }
 int main()
 {
     int a=10,b=20;
     swap(&a,&b);
     printf("%d %d",a,b);
     getch();
     return(0);
 }

Comments

Popular posts from this blog

How to set background color of navigation bar in iPhone

Checking Device Info in ios

Some Interactive tips to take input form GUI Dialogs