Show a diamond shape with numbers
Code issues that decrease readability and maintainability


Plenty of loops.  
Non-meaningful variable names: n, l, o.




We can declare the following helper methods:

private static string CreateDigitsString(int length)
{
    char[] buffer = new char[length];
    for (int i = 0; i &lt; buffer.Length; i++)
    {
        buffer[i] = (char)('1' + Math.Abs(buffer.Length / 2 - i));
    }
    return new string(buffer);
}

private static string CreateLine(int length, int spaces)
{
    return new string(' ', spaces) + CreateDigitsString(length - 2 * spaces) + new string(' ', spaces);
}


Then use it like:

const int N = 5;
const int TotalRows = N * 2 - 1;

for (int row = 0; row &lt; TotalRows; row++)
{
    Console.WriteLine(CreateLine(TotalRows, Math.Abs(N - row - 1)));
}




Another approach
In the 2-dimensional loop (i, j) we can calculate the distance between the current cell and the center of the diamond as follows:

int rowDistance = Math.Abs(row - N + 1);
int colDistance = Math.Abs(col - N + 1);


Let's output the colDistance for cells that are within rowDistance + colDistance &lt;= N - 1, and space - otherwise.

const int N = 5;
const int TotalSize = N * 2 - 1;

for (int row = 0; row &lt; TotalSize; row++)
{
    for (int col = 0; col &lt; TotalSize; col++)
    {
        int rowDistance = Math.Abs(row - N + 1);
        int colDistance = Math.Abs(col - N + 1);
        Console.Write(rowDistance + colDistance &lt;= N - 1 ? (char)('1' + colDistance) : ' ');
    }
    Console.WriteLine();
}