Want to see what people are talking about? See the latest forum posts.

Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 3714
Number of posts: 12956

This Forum Only
Post New Thread

Report
arrays Posted by maryenny on 26 Nov 2009 at 12:46 AM
Hello! I have a problem. Here is part of program in pascal. Why it gives value 0 for every element in array? I'd be very grateful if you'd help me.
program matricas;
 uses crt;

 var n,l,i,j,m,k,r:integer;

 pag : array[1..2,1..20]of integer;
 incid: array[1..15,1..15]of integer;
 blakus: array[1..15,1..20] of integer;
 label again,again2;

 BEGIN
 clrscr;
 again:
 writeln('9<n<16!');
 readln(n);
 if (n<10)or(n>15) then
 begin
 writeln('Vwrong!');
 goto again;
 end;

  again2:
  writeln('12<l<20!');
  readln(l);
 if (l<13)or(l>19) then
 begin
 writeln('wrong');
 goto again2;
 end;


writeln('...');
for i:=1 to l do
begin
     writeln('Ievadi ',i,'. loku : ');
     readln(pag[1,i]); 
     readln(pag[2,i]);   end;
for i:=1 to l do
begin
writeln(pag[1,i]);
writeln(pag[2,i]);
end;

Report
Re: arrays Posted by Atex on 26 Nov 2009 at 9:07 PM
: Hello! I have a problem. Here is part of program in pascal. Why it
: gives value 0 for every element in array?

It works fine for me...



 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A BootstrapLabs project.