title: Creating 2-dimensional array (nxn) *Pascal
body: <p>Does anyone know how to create Matrix using array function in Pascal?</p>
  
  <p>Output will be something like this:</p>
  
  <pre>
  00100
  01110
  11111
  01110
  00100
  </pre>
  
  <p>Thanks.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>This is my Code sofar:</p>
  
  <pre><code>program borlpasc;
  var a:array[1..100,1..100] of integer;
      i,j,n:integer;
  begin write('Enter the Number N='); {Example: 5}
     readln(n);
     for i:=1 to n do
         for j:=1 to n do
             begin a[i,j]:=0;
             if n mod 2 = 1 then begin
             a[n div 2 + 1, j] := 1;
             a[i, n div 2 + 1] := 1;
             end;
             end;
      for i:=1 to n do
          begin for j:=1 to n do write(a[i,j]:2);
              writeln
          end;
       readln
  end.
  </code></pre>
  
  <p></p>
  
  <p>but only get this:</p>
  
  <pre>
  00100
  00100
  11111
  00100
  00100
  </pre>