on
TCL
- Get link
- X
- Other Apps
#!/usr/bin/tclsh
puts "Please enter the first number:"
gets stdin firstNum
puts "Please enter the second number"
gets stdin secNum
proc swapNum {a b} {
puts "Input: [ list $a $b]"
set a [ expr $a + $b]
set b [ expr $a - $b]
set a [ expr $a - $b]
puts "Output: [ list $a $b]"
}
swapNum $firstNum $secNum
Please enter the first number:
34
Please enter the second number:
56
Input: 34 56
Output: 56 34
Comments
Post a Comment