Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Thursday 25 January 2018

C program to swap two numbers using bitwise operators

#include <stdio.h> int main() { int i = 100; int k = 121; printf(" value of i=%d k=%d before swapping", i, k); i = i ^ k; k = i ^ k; i = i ^ k; printf("value of i=%d k=%d after swapping", i, k); return 0; }

No comments:

Post a Comment