| Refresh | Home EGTry.com

find the minimum among all items in array


min min

min.ps

%!

%total of a seria of number

/Times-Roman findfont
20 scalefont
setfont



/newline {
	 10 currentpoint 20 sub exch pop     moveto
} def

/printN {
	10 string cvs show
} def


/space {
				currentpoint exch 10 add exch moveto
} def

/printNln {
 printN newline 
} def
/println {
				show newline
} def

/A [10 30 2 34 5] store

10 700 moveto

%set /Min as the first element
/Min A  0 get store
(Item) show space (Minimum) show newline
/A load
{
/Item exch store
Min Item gt {/Min Item store} if
Item  printN space Min printNln
} forall

showpage