When I run this code -
string binNumber="11111000001";
for(int ind=0; ind<binNumber.Length; ind++){
Console.WriteLine(binNumber[ind]&'1');
}
it prints sequence of 49 and 48 instead of 1 and 0.
I could not understand why is it happening? If I use the XOR operator it prints 1s & 0s. I have seen this behavior for & and | operator. The code can be accessed in the IdeOne here - https://ideone.com/fqZFUY.