#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main (){
char bits[128];
int i;
int one = 0;
char result;
printf("Enter the byte: ");
scanf("%127s", bits);
for(i=0;i<8;i++){
if(bits[i]=='1'){
one++;
}
}
if (one%2==0)
result = '0'; //byte is even
else
result = '1'; //byte is odd
printf("The result is: %s%c", bits, result);
return (EXIT_SUCCESS);
}