How does "|" operator evaluates two integer ? : I have some thing that i haven't yet wrapped my head around yet

    enter code here

#include<iostream>

    int main()
    {
    int x,y,z;
    x=2;
    y=4;
    
    z=x|y;
    
    }

why does z gets assigned 6 how does this work

    