using System;
using System.Collections.Generic;
using System.Text;
namespace diamond
{
class Program
{
static void Main(string[] args)
{
Program p = new Program();
p.acc();
}
public void acc()
{
Console.Write("Enter the number: ");
int n = int.Parse(Console.ReadLine());
for (int i = 0; i <= n; i++)
{
Console.ForegroundColor = ConsoleColor.Gray;
for (int a = n - 1; a >= i; a--)
{
Console.Write(" ");
}
for (int j = 0; j <= i; j++)
{
Console.Write("*");
}
for (int y = 1; y <= i; y++)
{
Console.Write("*");
}
Console.WriteLine();
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= i; j++)
{
Console.Write(" ");
}
for (int k = n; k >= i; k--)
{
Console.Write("*");
}
for (int k = n - 1; k >= i; k--)
{
Console.Write("*");
}
Console.WriteLine(" ");
Console.ForegroundColor = ConsoleColor.Blue;
}
Console.ReadKey();
}
}
}
KINGMAKER'S
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.