0% found this document useful (0 votes)
8 views2 pages

Pascal Array Initialization and Output

The document contains two Pascal programs that demonstrate the use of arrays. The first program initializes an array with four integers and prints them, while the second program defines a larger array with a range from -1 to 19, populates it with values, and prints them. Both programs utilize the 'crt' unit for console input/output operations.

Uploaded by

Drexla Ree
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Pascal Array Initialization and Output

The document contains two Pascal programs that demonstrate the use of arrays. The first program initializes an array with four integers and prints them, while the second program defines a larger array with a range from -1 to 19, populates it with values, and prints them. Both programs utilize the 'crt' unit for console input/output operations.

Uploaded by

Drexla Ree
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

program array1;

uses crt;

Type

numbers=array[1..4] of Integer;

Var

num:numbers;

i: Integer;

Begin

num[1]:=564;

num[2]:=854;

num[3]:=425;

num[4]:=938;

For i:=1 To 4 Do

Begin

WriteLn(num[i]);

End;

ReadKey;

End.
program array1;

uses crt;

Type

numbers=array[-1..19] of Integer;

Var

num:numbers;

i: Integer;

Begin

(*num[1]:=564;

num[2]:=854;

num[3]:=425;

num[4]:=938;*)

For i:=-1 To 19 Do

Begin

num[i]:=i+1;

End;

For i:=0 To 19 Do

Begin

Write(num[i], ' ');

End;

ReadKey;

End.

You might also like