
{
PROGRAMMED BY   : MOHAMMAD ALJADA
DOWNLOADED FROM : WWW.GEOCITIES.COM/MOHJADA
PROGRAM         : Search
}


uses wincrt;
type arr=array[1..10] of integer;
var a:arr;
    val,pos,i:integer;


function search(a:arr;val:integer):integer;
begin
search:=-1;
for i:=1 to 10 do
if a[i]=val then search:=i;




end;



BEGIN
randomize;
for i:=1 to 10 do
begin 
a[i]:=random(100);
write(a[i]:5);
end;
writeln;

write('Input Number To Search : ');
readln(val);

pos:=search(a,val);
writeln;

if pos=-1 then
writeln('Item Not Found')
else
writeln('Item Found In Position : ',pos);


END.





