Hello,
I wrote a program where a user types in five numbers, and then it displays the numbers in the order of which they were typed. But i need to make my program Print the numbers that the user enters from least to greatest. Any idea how i can do this? So far i got.
#! /usr/bin/perl print "Type in a number."; $n1 = <>; print "Type in another number."; $n2 = <>; print "Type in another number."; $n3 = <>; print "Type in another number."; $n4 = <>; print "Type in another number."; $n5 = <>; print "$n1 \n"; print "$n2 \n"; print "$n3 \n"; print "$n4 \n"; print "$n5 \n";
Thanks a million.
In reply to How to make perl sort these values in order? by rse2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |