Quiz – Byte iteration in C#
At some job interviews you will be asked to explain a small piece of code, so I thought it could be fun to post some on my blog. If anyone has other examples, please let me know.
Question
How many times will Console.Write() be called ?
1 2 3 4 | for (byte i = byte.MinValue; i <= byte.MaxValue; i++) { Console.Write(i); } |
A little tip
Information about Byte Structure
I had to copy paste that into Visual Studio to figure it out, seemed too easy. Won’t spoil it for anyone.
Thanks Richard ;)