Also you really only need one input for the number not three.
Also you can use Select Case ( http://www.freebasic.net/wiki/wikka.php ... Selectcase )
Your code fixed:
Code: Select all
do
input "Type bin for binary, hex for hexadecimal or oct for octal: ",
choice$
input "Type your number: ", nmbr%
If choice$ = "bin" then
print bin$(nmbr%)
If choice$ = "hex" then
print hex$(nmbr%)
If choice$ = "oct" then
print oct$(nmbrl%)
loop
Code: Select all
do
input "Type bin for binary, hex for hexadecimal or oct for octal: ", choice$
input "Type your number: ", nmbr%
select case nmbr$
case "bin"
print bin$(nmbr%)
case "hex"
print hex$(nmbr%)
case "oct"
print oct$(nmbr%)
end select
loop
Code: Select all
do
input "Type bin for binary, hex for hexadecimal or oct for octal: ", choice$
input "Type your number: ", nmbr%
select case nmbr$
case "bin"
print bin$(nmbr%)
case "hex"
print hex$(nmbr%)
case "oct"
print oct$(nmbr%)
case else
print "Invalid selection"
end select
loop