Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,22 @@
#!/bin/ksh
# tested with ksh93s+
builtin printf
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

View 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

View file

@ -0,0 +1,9 @@
read -p "Enter two integers: " a b
if [ $a -gt $b ]; then comparison="greater than"
elif [ $a -lt $b ]; then comparison="less than"
elif [ $a -eq $b ]; then comparison="equal to"
else comparison="not comparable to"
fi
echo "${a} is ${comparison} ${b}"