# Example 2

Generate first hundred whole numbers.

What is a whole number?

Whole numbers are the natural numbers including 0. This means 0, 1, 2, 3, 4, ... are whole numbers.

 




for (int i = 0; i < 100; i++)
{
  Console.WriteLine(i);
}
1
2
3
4

Notice that in line 1, we start the loop from 0 and finish it at 99.

Last Updated: Apr 23, 2020, 10:50 AM