echo "Enter number:"
read no;
count=0
total=0
while [ $no -ne 0 ]
do
a=`expr $no % 10`
no=`expr $no / 10`
total=`expr $total + $a`
count=`expr $count + 1`
done
if [ `expr $no % 2` -eq 0 ]; then
echo "NUMBER IS EVEN"
else
echo "NUMBER IS ODD"
fi
echo "SUM OF ALL DIGITS:$total"
echo "TOTAL NUMBER OF DIGIT:$count"
pleas Display value of $no
ReplyDeletebefore if condition
And Let Me Know The Answer.