I am executing the following code, and without introducing a breakpoint I cannot execute the last two lines ., It doesn't execute NumberOut
Console.WriteLine("Enter a positive whole number: ");
int NumberIn = Console.Read();
int NumberOut = 0;
int count = 0;
while (NumberIn > 0)
{
count = count + 1;
int PartValue = NumberIn % 2;
NumberIn = NumberIn / 2;
for (int i = 0; i < count - 1; i++)
{
PartValue = PartValue * 10;
}
NumberOut = NumberOut + PartValue;
}
Console.WriteLine("the result is: {0}", NumberOut);
Console.ReadLine();