Please Help me out to print this pattern and also explain logic behind it. THank you in advance.
0
111
22222
3333333
My Pascal Code is:
program patnum;
uses crt;
var
row, col1, col2, totalRows, totalCol: integer;
Begin
clrscr;
totalRows := 3;
totalCol := totalRows-2;
for row := 0 to totalRows do
begin
for col1 := 0 to totalCol do
begin
write(' ');
end;
totalCol := totalCol - 1;
for col2 := 0 to row do
begin
write(row);
end;
writeln('');
end;
readln;
End.
* Please Help *