Program n1; const n=10; var a: array[1..n] of integer; i,num,kt: integer; begin randomize; kt:=0; num:=0; for i:=1 to n do begin a[i]:=random(25)-12; write(a[i],' '); end; for i:=1 to n do if a[i] mod 5=0 then begin num:=i; kt:=kt+1; if kt=2 then break; end; writeln; write(num); end.
Answers & Comments
Verified answer
Program n1;const n=10;
var a: array[1..n] of integer;
i,num,kt: integer;
begin
randomize;
kt:=0;
num:=0;
for i:=1 to n do
begin
a[i]:=random(25)-12;
write(a[i],' ');
end;
for i:=1 to n do if a[i] mod 5=0 then begin
num:=i;
kt:=kt+1;
if kt=2 then break;
end;
writeln;
write(num);
end.