EDIT:Code:1 121 12321 1234321 123454321
the above pyramid looks like a doom.i.e 1-5 will be in center.1-4(L)1-3(L)1-2(L)1(L) similarly 1-4(R) 1-3(R) 1-2(R) 1(R)
I'm partly successful in building the requirement of the program.but cant able to think the logic for the other half.please tell me how can i proceed.below is the code written in c#.
Code:for (int i = 1; i <= 5; i++) { //int l = 1; int k = 1; for (int j = 5; j >=1; j--) { if (j > i) { Console.Write(" "); } else { Console.Write(k++); } } Console.WriteLine(); }