Files
  • main.cs
  • main.exe
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;

class DrawRhombusNestedLoops {
    public static void Main() {        
        int n = 10;
        for (int row = 1; row < n; row++)
        {
            var spaces = Math.Abs(n / 2 - row);
            var stars = n/2 - spaces;
            for (int col = 1; col <= spaces; col++)
                Console.Write(" ");
            for (int col = 1; col <= stars; col++)
                Console.Write("* ");
            Console.WriteLine();
        }
    }
}