OK Hi peeps new to daniweb. I have a script missing for one of my classes because I missed due to work :( It's a very simple4 script (I think) It need to eccept the input of ten numbers compair them and output the highest number. This simpler the better here folks. Please Help. *Pulling Hair out!* :S
dewey_witt 0 Newbie Poster
Recommended Answers
Jump to PostWith zsh:
% set -- 03 32 156 4 593 2 033 490 5 12 % print ${${(n)@}[-1]} 593
with sort:
$ numbers="03 32 156 4 593 2 033 490 5 12" $ set -- $(printf "%d\n" $numbers|sort -nr) $ printf "%d\n" "$1" 593
All 3 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.