Answers for "how to swap using bitwise operator"

0

how to swap using bitwise operator

#include<stdio.h>
void main()
{
    int a,b;
    printf("Enter the value of a and b: ");
    scanf("%d %d", &a, &b);
    a = a^b;
    b = b^a;
    a = a^b;
    printf("Value of a is: %d\n", a);
    printf("Value of b is: %d\n", b);
}
Posted by: Guest on June-01-2021

Code answers related to "how to swap using bitwise operator"

Browse Popular Code Answers by Language