SP – Digits count

# Shell programming

# Number of digits in a number


echo -n “Enter a number : “

read n

i=1

while [ $n -gt 10 ]

do

n=`expr $n / 10`

i=`expr $i + 1`

done


echo “Number of digits is $i”