Checking for an Age Range in tcl-tk.

p17.tcl

#!/bin/tclsh

puts "How old are you?"
gets stdin age
if {$age >= 0 && $age <= 12} {
puts "You are a child"
} elseif {$age >= 13 && $age <= 19} {
puts "You are a teen."
} elseif {$age > 19} {
puts "Your are an adult."
}














Post a Comment

Previous Post Next Post