Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
proc sort {l m n} {
set a $l
set b $m
set c $n
if { $m > $a } {
set a $m
set b $l
set c $n
}
if { $n > $a } {
set a $n
set b $m
set c $l
}
if { $c > $b } {
set t $b
set b $c
set c $t
}
return [expr "$a$b$c"]
}
puts "ENTER 1st NUMBER FOR SORT :"
set x [gets stdin]
puts "ENTER 2nd NUMBER FOR SORT :"
set y [gets stdin]
puts "ENTER 3rd NUMBER FOR SORT :"
set z [gets stdin]
set r [sort $x $y $z]
puts $r
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more