Sunday, October 14, 2018

Pascal program print number pattern

Pascal program to print number Pattern as below


NumberPatternPascalProgram

Pascal Program
 

program printnumpattern;
var
   i,j:integer;
begin
  i:=1;
  while i<=10 do {first repetition}
  begin
    j:=1;
    while j<=i do {second repetition within first}
    begin
          write(j,#9); {print numbers horizontally}
          j:=j+1;
    end; {second repetition end}
    write(#13#10); {to goto next line}
    i:=i+1; 
  end;{first repetition end}
  write('Press Enter to exit');
  readln;
end.


No comments:

Post a Comment