Showing posts with label array in pascal. Show all posts
Showing posts with label array in pascal. Show all posts

Saturday, July 30, 2016

Array in Turbo Pascal

Here is a sample program that I wrote using Pascal to accept five numbers from the user and then display the numbers given by the user using Array as my data structure in Pascal. The code is very simple and easy to understand.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing

Program List_Values;
Uses Crt;

Type
  values = array[1..5] of integer;

Var item : values;
    a: integer;
Begin
  clrscr;
  For a := 1 to 5 Do
  Begin
    Write('Enter value in item no. ' ,a,':');
    readln(item[a]);
  End;
   Writeln;
   Writeln;
   Write('List of Values You Given');
   Writeln;
   For a := 1 to 5 Do
   Begin
     writeln(item[a]);
   End;
   Readln;
End.