Code:sbyte x = -4; Console.WriteLine("Suppose we have an sbyte with value -4."); Console.WriteLine("The size of sbyte is {0} byte.", sizeof(sbyte)); Console.WriteLine("The sbyte converted to binary string is: {0}", Convert.ToString(x, 2));If sbyte is 8 bits, why does Convert.ToString yield 16-bit output?Code:Output: Suppose we have an sbyte with value -4. The size of sbyte is 1 byte. The sbyte converted to binary string is: 1111111111111100
Thanks.




Reply With Quote