i can not do a multiblying table by pascal in this form
1 2 3 4 5 6 7 8 9 10 11 12
1 1 2 3 4 5 6 7 8 9 ...........
2 2 4 6............................
3 ..............................
4 ...................
5 .
6 .
7 .
8 .
9 .
10 .
11 .
12 .


i can not do this i tyed to do but i can not do it at this form
i did two counters loop and multeblying them each other but there are not wat i want

i will be so happy 2 help me
thank u

Dani AI

Generated

A simple nested loop is the right idea (as in 's reply), but column alignment is usually the tricky part. Tabs (chr(9)) can look OK for small numbers but often misalign when digits vary or when the output is viewed in a non‑monospaced place. A more robust approach is fixed‑width fields: print a short row header, then the column headers, and format every cell with a fixed width so columns line up.

program mtable;
uses SysUtils;
var
  i, j, n: Integer;
begin
  n := 12;
  write('    ');                { 4 spaces for the left column label }
  for j := 1 to n do
    write(j:4);
  writeln;
  for i := 1 to n do
  begin
    write(i:4);                { row label }
    for j := 1 to n do
      write(i * j:4);
    writeln;
  end;
end.

A compact Python 3 equivalent uses f-strings and the same fixed-width idea:

n = 12
print('    ' + ''.join(f'{j:4}' for j in range(1, n+1)))
for i in range(1, n+1):
    print(f'{i:4}' + ''.join(f'{i*j:4}' for j in range(1, n+1)))

Notes and troubleshooting: choose the field width to fit the largest product (for general n, width = len(str(n*n)) + 1). Fixed widths make the table stable across consoles and editors; tabs often break alignment. If the output will be posted on the web, a monospaced block (or exporting to CSV/Excel) preserves alignment better than plain HTML text. This builds on 's loop approach while avoiding tab-related misalignment.

Recommended Answers

All 2 Replies

It would help if you could spel.

Not exactly the formatting you wanted but should get you started...

program mtable;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
   I : Integer;
   J : Integer;
begin
   for I := 1 to 12 do
   begin
      for J := 1 to 12 do
      begin
         write( IntToStr( J * I ) + chr( 9 ) );
      end;
      writeln;
   end;
end.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.