I want to be able to print a diamond like this when the user enters 5 for the diamond. But also will work for any value that is odd and greater than 0.
static void Main(string[] args)
{ //check this out more optimized code hope it will be help full.
for (int row=-2;row<=2;row++)
{
for (int col=-2;col<=2;col++)
{
if (Math.Abs(row)+Math.Abs(col)<=2)
{
Console.Write("*");
}
else
{
Console.Write(" ");
}
}
Console.WriteLine();
}
Console.ReadKey();
}