Social Icons

Wednesday 1 May 2013

Reverse Of a No.


#!/bin/sh

echo -n "Enter any no to find Reverse :  "
read  n
p=$n
rev=0
while [ $n -gt 0 ]
do
z=$(($n%10))
n=$(($n/10))
rev=$(($(($rev*10)) + z))
done
echo " .............reverse of the no. is : ........   : $rev"
exit 0
Output :



No comments:

Post a Comment

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management