C# printing for loop -
C# printing for loop -
i want print this:- 1 121 12321 1234321 123454321
this programme prints this. error in programme ? in loop ? please tell me how prepare this. error in logic using. if so, problem in logic ? how should think algorithms in near future ? :- 1 12 123 123432 123454321
using system; using system.collections.generic; using system.linq; using system.text; namespace consoleapplication1 { class programme { static void main(string[] args) { int a, b, c, d, e; b = 6; for(a=b;a>=1;a--) { (c = a; c >=1; c--) { console.write(" "); } for(d=1; d<=b-a;d++) { console.write(d); } (e = b-a-1; e>=a; e--) { console.write(e); } console.writeline(); } } } }
please tell me problem in code.
the problem in line for (e = b-a-1; e>=a; e--)
change for (e = b-a-1; e>=1; e--)
c#
Comments
Post a Comment