Created
April 8, 2017 13:10
-
-
Save lazyakshay/8545500400634abe7b54e9de2375faae to your computer and use it in GitHub Desktop.
print the digit that are at odd position
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "enter 5 digit number" | |
read number | |
n=1 | |
while((n<=5)) | |
do | |
a=`echo $number | cut -c $n` | |
echo -n "$a" | |
n=`expr $n + 2` | |
done | |
echo " " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment