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