title: 2D Array - in PASCAL with loop
body: <p>I need to write a program which demonstrates 2d array, the program need to ask for student name and then the mark.. and this is for 15 students. At the end program outputs 15 names with their marks next to it.</p>
  
  <p>I don't know how to manipulate 2D arrays accurately, I managed to do simple version without using for loop.</p>
  
  <p>`</p>
  
  <pre><code>table: array[1..2, 1..15] of string;   {2 rows for 15 columns}
  
  
  begin
  clrscr;
  writeln('Enter 15 student names, and a set of marks after each ');
  writeln('With marks you can enter more marks after comma for e.g. 34, 26, 31 etc.');
  
  writeln('Enter NAME and SURNAME of STUDENT NR 1 or q to quit ');
  read(table[1][1]);                    {read name in row 1 col 1}
  readln;                                      
  writeln(' Enter MARKS of STUDENT NR 1 ');
  read(table[2][1]);                     { read mark in row 2 col 1}
  readln;             
  clrscr;
  
  writeln('Enter NAME and SURNAME of STUDENT NR 2 or q to quit ');
  read(table[1][2]);
  readln;             
  writeln('Enter MARKS of STUDENT NR 2 ');
  read(table[2][2]);
  readln;             read marks into row 2 column 2}
  
  `
  </code></pre>
  
  <p>etc. up to student nr 15... but I know I could use two for loops to do that for me instead of copying  code for each student... same for output... I've spend many hours to figure out how to do it with different tries... but still Im confused with using two for loops and indexing this array correctly.</p>
  
  <p>could someone help me with this appropriate looping ?</p>
  
  <p>Thanks</p>