Reverse triangle program to display *
Hi ,I need a program which has to display triangle in reverse
eg
*****
***
*
Thanks Inadvance,
sachin
private void DrawReverse(int lines)
{
for (int i = 0; i < lines; i++)
{
int count = (lines-i) * 2 - 1;
string str = new string('*', count);
Console.WriteLine(str);
}
}
private void Button1_Click_1(object sender, EventArgs e)
{
label1.Text = "";
for (int i = 5; i >= 1; i--)
{
if (i % 2 == 1)
{
for (int j = i; j >= 1; j--)
{
label1.Text += "*";
}
}
else
{
label1.Text += "\n";
}
}
}
Console.WriteLine("Enter the number:");
string count = Console.ReadLine();
for(int i=count; i>0; (i-2))
{
for(int j=i; j>0; j--)
{
Console.Write("*");
}
Console.Write("\n");
}
for(int iCount=5; iCount>0; (iCount-2))
{
for(int jCount=iCount; jCount>0; jCount--)
{
Console.Write("*");
}
Console.Write("\n");
}