echo "Enter three sides of triangle"
read a
read b
read c
if test `expr $a \* $a` -eq `expr $b \* $b + $c \* $c`
then
echo "$a, $b, and $c are the sides of a right angled triangle"
elif test `expr $b \* $b` -eq `expr $a \* $a + $c \* $c`
then
echo "$a, $b, and $c are the sides of a right angled triangle"
elif test `expr $c \* $c` -eq `expr $a \* $a + $b \* $b`
then
echo "$a, $b, and $c are the sides of a right angled triangle"
else
echo "$a, $b, and $c are not the sides of a right angled triangle"
fi
No comments:
Post a Comment