Tuesday, 3 November 2015

Linux Shell program to reverse a number

echo "enter a number:"
read n
while [ $n -gt 0 ]
do
echo -n `expr $n % 10 `
n=`expr $n / 10 `
done


OUTPUT:
enter a number: 345
543

No comments:

Post a Comment