echo "enter a number" read n j=$n s=0 while [ $n -gt 0 ] do r='expr $n % 10' n='expr $n / 10' s='expr $s + $r \* $r \* $r' done if test $s -eq $j then echo "Armstrong number" else echo "not an armstrong" fi
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)