Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 3909
Number of posts: 13625

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

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...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 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.
Operated by CommunityHeaven, a BootstrapLabs company.