C# Program toward Print half Diamond shapes using numbers 1 toward 10Program Statement:Write a program toward produce the following output:
1
2 3
4 5 6
7 8 9 10
Solution:
static void Main(string[] args)
{
int i,j,k=1;
beneficial to (i = 1; i <= 4; i++)
{
beneficial to (j = 4; j >= 1; j--)
{
if (j > i)
Console.Write(" ");
else
Console.Write(" " + k++ + " ");
}
Console.WriteLine();
Console.WriteLine();
}
Console.ReadLine();
}