What is the output for the following code?
public class Test
public static void Main(string args)
int x = 258;
byte b = (byte)x;
Byte data type range is from 0 to 255 means it can store total 256 values. When you try to assign 258 into byte it cannot accommodate this value and hence clr deducts total allowed values from the given value.
In this case 258-256
Back To Top