AZBC-REPO menu | @ | list
imagetextmenustatus


BitWiseOr

self

<> BitWiseOr :: Boolean OR :: inclusive OR -




BitWiseOr


De bitwise OR-operatie heeft 2 strings met een gelijk aantal bits als operands. De OR-operatie wordt voor elk paar [a, b] uitgevoerd.

a | 0 0 0 0 0 1 1 0 | = 6
b | 0 0 0 0 0 0 1 1 | = 3
   -----------------
c | 0 0 0 0 0 1 1 1 | = 7

In ' C ' kan een bitwise-OR operatie worden uitgevoerd op twee variabelen.

#include <stdio.h>

int main() {
        unsigned short int a, b, c;
        a = 6;
        b = 3;
        c = a | b;

        printf("%u\n", c);
}

Het resultaat is 7


BitWiseOr
05.01.2021


status | Page | data.boole | BitWiseOr