Last active
August 24, 2016 13:01
-
-
Save dflima/f9c95bd25b0e6e1c989b7a357b937d22 to your computer and use it in GitHub Desktop.
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 number to be converted: " | |
read no | |
echo "Converting $no from decimal to binary (base2)" | |
no=`echo "obase=2;$no" | bc` | |
echo Binary: $no | |
echo "Converting binary($no) to decimal" | |
no=`echo "obase=10;ibase=2;$no" | bc` | |
echo Number in decimal: $no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment