Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Integer-comparison/UNIX-Shell/integer-comparison-2.sh
Normal file
20
Task/Integer-comparison/UNIX-Shell/integer-comparison-2.sh
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/ksh
|
||||
# tested with pdksh
|
||||
|
||||
integer a=0
|
||||
integer b=0
|
||||
|
||||
read a?"Enter value of a: " || { print -u2 "Input of a aborted." ; exit 1 ; }
|
||||
read b?"Enter value of b: " || { print -u2 "Input of b aborted." ; exit 1 ; }
|
||||
|
||||
if (( a < b )) ; then
|
||||
printf "%d is less than %d\n" $a $b
|
||||
fi
|
||||
if (( a == b )) ; then
|
||||
printf "%d is equal to %d\n" $a $b
|
||||
fi
|
||||
if (( a > b )) ; then
|
||||
printf "%d is greater than %d\n" $a $b
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue