#include <stdio.h>

int main() {
    int a,b;
    scanf("%d%d",&a,&b);
    int x=0,y=0,z=0;
    for (int i=1; i<=a; i++) {
        for (int j=i+1; j<=a; j++) {
            if (((i&j) > x) && ((i&j) < b)) {
                x = i&j;
            }
            if (((i|j) > y) && ((i|j) < b)) {
                y = i|j;
            }
            if (((i^j) > z) && ((i^j) < b)) {
                z = i^j;
            }
        }
    }
    printf("%d\n%d\n%d\n",x,y,z);
    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: