Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int i = 5000;
- byte b = (byte)i;
- Console.WriteLine(b); // outputs 136
- checked
- {
- int i = 5000;
- byte b = (byte)i;
- Console.WriteLine(b);
- }
- int i = 5000;
- byte b = checked ( (byte)i );
- Console.WriteLine(b);
- int i = 256;
- byte b = (byte)i;
- Console.WriteLine(b); // output = 1
- int i = 257;
- byte b = (byte)i;
- Console.WriteLine(b); // output = 2
Add Comment
Please, Sign In to add comment