Monday 27 October 2014

how to print * As triangle by using ForLoop in C#

static void Main()
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
console.Write("*");
}
Console.WriteLine();
}
}


OutPut:

*
**
***
****
*****

No comments:

Post a Comment