+ 1
I want to capture 10 integers at random into an array D. How should i write a Pascal program to display the elements of the aray
using while do loop
1 Réponse
+ 2
random(100) will give a random number between 0 and 99. This would define your index and array for the loop:
var
index: integer;
arr: array [1..10] of integer;
This would display the array:
index := 1;
while index <= 10 do
begin
writeln("Array[", index, "] is ", arr[index]);
index := index+1;
end;
You would have to put the values into the array, first.