Statistics: Posted by kidingwithlaura — Tue Mar 01, 2016 10:46 am
Statistics: Posted by MystikShadows — Sat Jun 06, 2009 6:20 pm
Statistics: Posted by burger2227 — Fri Jun 05, 2009 11:11 pm
Statistics: Posted by MystikShadows — Fri Jun 05, 2009 8:03 pm
Code:
SUB Bin2DecCOLOR 14: LOCATE 2, 30: PRINT "Binary to Decimal"COLOR 10: LOCATE 5, 20: PRINT "Enter a binary number (1's or 0's):"DO: Bin$ = INKEY$ 'string number entry 1 or 0 with backspace IF Bin$ = "1" OR Bin$ = "0" THEN Binary$ = Binary$ + Bin$ L = LEN(Binary$) IF L > 0 AND Bin$ = CHR$(8) THEN Binary$ = MID$(Binary$, 1, L - 1) COLOR 14: LOCATE 5, 57: PRINT Binary$; " "LOOP UNTIL L > 0 AND Bin$ = CHR$(13) 'enter quits FOR i = 0 TO L - 1 place = VAL(MID$(Binary$, L - i, 1)) dec = place * 2 ^ i Decimal = Decimal + decNEXTCOLOR 11: LOCATE 10, 30: PRINT "Decimal number ="; DecimalEND SUB
Statistics: Posted by burger2227 — Fri Jun 05, 2009 12:45 pm
Statistics: Posted by Harry Potter — Fri Jun 05, 2009 11:42 am
Statistics: Posted by jimmy — Fri Jun 05, 2009 8:03 am