c bitwise or code example
Example 1: bitshift c
i = 14; // Bit pattern 00001110
j = i >> 1; // here we have the bit pattern shifted by 1 thus we get 00000111 = 7 which is 14/2
Example 2: C bitwise
#include <stdio.h>
int main(void) {
unsigned int a = 60; //Equal to: 0011 1100
unsigned int b = 13 // Equal to: 0000 1101
int both = a & b //If both are 0, then its a 0,
// if both are 1, then its a 1. //0000 1100
printf("%d\n", both);
}