#include <stdio.h>

int main() {
    unsigned int binaryValue = 0b01011;  // Example binary value

    //here we do calculte the last bit from a value 1 0r 0
    //00001 means 1 when we & it with our value we comare the last bits value
    int lastBit = (binaryValue >> 4) & 1;
    //1&1=1 others all 0 so we store only the last value into and the we 
    //will right shift

    printf("Binary value: %u\n", binaryValue);
    printf("Value of the last bit: %d\n", lastBit);

    return 0;
}

Embed on website

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