console shape Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication8
{
class Program
{
static void Main()
{
Console.WriteLine("Shape 1:");
for (int i = 0; i < 7; i++)
{
for (int j = 0; j < 4; j++)
{
if ((((i + j) > 2) && (i <= 3)) || ((i > 3) && (j >= i - 3)))
{
Console.Write("*");
}
else
{
Console.Write(" ");
}
} Console.WriteLine();
} Console.WriteLine("\nShape 2:");
for (int i = 0; i < 7; i++)
{
for (int j = 0; j < 7; j++)
{
if (((((i + j) > 2) && (j < 4)) || ((j - i <= 3) && (j >= 4))) && (i <= 3))
{
Console.Write("*");
}
else if ((i > 3) && (((j >= i - 3) && (j <= 3)) || ((j > 3) && (i + j < 10))))
{
Console.Write("*");
}
else
{
Console.Write(" ");
}
} Console.WriteLine();
} Console.ReadLine();
}
}
}
screenshot
-----------------------------------------------------------------------------------------------------------