Convert Any Base To Any Base

Write a Shell Script to convert any base to any base Shell Script: clear echo "enter input base" read ib echo "enter output base" read ob echo "enter number in input base" read n res=`echo "obase=$ob;ibase=$ib;$n"|bc` echo result $res OUTPUT: 1)[admin@localhost ~]$ sh base.sh enter input base 10 enter output base 2 enter number in input base 8 result 1000 2)[admin@localhost ~]$ sh base.sh enter input base 16 enter output base 10 enter number in input base C result 12

Share:

0 comments