how to implement program using c#

Posted by Naidulaxmi under C# on 12/19/2013 | Points: 10 | Views : 558 | Status : [Member] | Replies : 2
Hi friends,


I want to implement program below format
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

Please help me and please gr through the attachment

Thanks,
Naidu.

appalanaidu


Responses

Posted by: vishalneeraj-24503 on: 12/19/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
public static void Main(string[] args)
{
Console.Write ("Type number of rows: ");
string rows = Console.ReadLine();
int noLines;
int.TryParse (rows, out noLines);

for (int row = 1; row <= noLines; row++)
{
for (int column = 1; column <= row; column++)
{
Console.Write("{0} ", column);
}
Console.WriteLine();
}
}

}

Naidulaxmi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: vishalneeraj-24503 on: 12/19/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
refer:-
http://www.dreamincode.net/forums/topic/199249-asterisks-patterns-in-c%23/

Naidulaxmi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response