First of all the code that you mentioned is in page 67 of my printed version of the book. Weird??? I don't see any problem with the code you mentioned either. The authors are trying to explain how the do...while loop works. The code in the book prints numbers 1 to 10 like it is supposed to.
If you are confused by the use of "{0}", i++ instead of $"{i}",i++ then both of these are valid C# code. Use of $"{i}",i++ being the latest C# 6.0 feature.
Try copying the code within -------- in visual studio and try it out.
-------------------------------------------------------------------------------
using System;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
int i = 1;
do
{
Console.WriteLine("{0}",i++);
} while(i <= 10);
Console.ReadKey();
}
}
}
----------------------------------------------------------------------------------
// Prints out
1
2
3
4
5
6
7
8
9
10
Hope this helps you understand how do...while loop works!
