Bitwise calculation : Bitwise XOR « Data Type « C / ANSI-C






Bitwise calculation

Bitwise calculation
#include <stdio.h>

int main(void)
{
  int i;

  i = 100;
  printf("initial value of i: %d\n", i);

  i = i ^ 219;
  printf("i after first XOR: %d\n", i);

  i = i ^ 219;
  printf("i after second XOR: %d\n", i);

  return 0;
}


           
       








Related examples in the same category

1.the xor() function
2.Perform a logical XOR operation using the two arguments