Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

write a bash program to print a given number in reverse order

n=123465
sd=0
rev=0
while [ $n -gt 0 ]
do
    sd=$(( $n % 10 ))
    rev=$(( $rev * 10 + $sd ))
    n=$(( $n / 10 ))
done
echo "Reverse number of entered digit is $rev"
Comment

PREVIOUS NEXT
Code Example
Shell :: ubuntu 14 apache2 graceful restart 
Shell :: how to uninstall create-react-app 
Shell :: get ip mac terminal 
Shell :: uninstall imagemagick ubuntu 
Shell :: install ngrok ubuntu 20.04 
Shell :: ls file size 
Shell :: yarn install 
Shell :: install beautifulsoup windows 
Shell :: linux install ping 
Shell :: check if nginx is running 
Shell :: Install Etcher on Ubuntu 22.04 
Shell :: debian install node js 
Shell :: find folder linux 
Shell :: install tmux ubuntu 
Shell :: install pandas conda 
Shell :: install pip arch linux 
Shell :: @mui/lab install 
Shell :: Install / Update Dbeaver Community on Ubuntu 
Shell :: uninstall foxit reader ubuntu 18.04 
Shell :: adb port issue fix 
Shell :: zoom download linux 
Shell :: vim ubuntu install 
Shell :: check active ssh connections on linux 
Shell :: install workbench on ubuntu 
Shell :: how to delete tor browser in ubuntu 
Shell :: how to restart heroku server 
Shell :: firebase-tools npm 
Shell :: android_home ubuntu 
Shell :: CocoaPods specs repository is too out-of-date to satisfy dependencies. 
Shell :: sudo: /etc/sudoers is owned by uid 1001, should be 0 sudo: no valid sudoers sources found, quitting 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =