using System;
public class Program
{
public static void Main()
{
// Define the range parameters.
const double start = 0.0;
const double step = 0.1;
const int count = 11; // Generates 0.0 through 1.0 inclusive.
/*
* Use an integer loop counter.
* Each floating-point value is calculated independently,
* avoiding cumulative rounding errors.
*/
for (int i = 0; i < count; i++)
{
double value = start + (i * step);
Console.WriteLine($"{value:F1}");
}
}
}
/*
run:
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
*/