Hi IT
Knowledge lover… you are on my blog, that in “We Are Knowledge”… You enter the
right blog, because in here you will getting many IT knowledge, from dekstop
programming untilweb programming. besides that there are also general knowledge
likely receip Indonesian foods.
But
now, I want giving you IT knowledge about “Pascal” and discuss of “Array in
Pascal”.
OK
direct to learn… have fun to read my article… let’s gooo..
You
can copy this coding, and paste in your aplication likely “turbo pascal” or
copy in your notepad or notepad++.
Example 1 :
uses crt;
TYPE INDEKS =
1..10;
VAR A :
ARRAY [INDEKS] OF INTEGER;
J :
INTEGER;
TOTAL :
INTEGER;
AVERAGE :
REAL;
BEGIN
clrscr;
Total := 0;
FOR J :=
1 TO 10 DO
BEGIN
write ('element number
- ',J,' : ');
READ (A[J]);
TOTAL := TOTAL + A[J];
readln;
END;
AVERAGE := TOTAL / 10;
writeln;
WRITE (AVERAGE);
readln;
END.
Note ::
If you using copy
paste, please change all quotes (“ “) or (‘ ‘) in program
To compile program
>> “alt + F9”
To running program
>> “ctrl + F9”
If you input number 1
to 10 is “3, 5, 7, 1, 4, 6 , 9, 8, 0, 3.
And result :
element number - 1 : 3
element number - 2 : 5
element number - 3 : 7
element number - 4 : 1
element number - 5 : 4
element number - 6 : 6
element number - 7 : 9
element number - 8 : 8
element number - 9 : 0
element number - 10 : 3
4.60000000E+00_
Logic :::
Array
>> ARRAY useful
for saving many element... because it Array can to substarch code or economical
code...
>> like as
example my article, I saving 10 element in one array...
Thanks For readerand
visitors... If you have quetions, can fill comentar box
OK just it….
I hope you like with my
article…
See you the IT knowledge
lover..
No comments:
Post a Comment