swap two numbers

#include<stdio.h>
int main() {
    int x,y;
    scanf("%d%d",&x,&y);
    x ^= y;
    y ^= x;
    x ^= y;
    printf("After swapping  %d %d ",x,y);
   
return 0; 
}

Input
5 6

Output

After swapping  6 5 

No comments:

Post a Comment