Binary To Decimal Covertor
Author |
Message |
vexd
|
Posted: Mon Sep 29, 2003 6:35 pm Post subject: Binary To Decimal Covertor |
|
|
%************************************************************************************ ||
%* Author: VeXD *__||
%* Date: Sept, 24 2003 ___)
%* Purpose: To make a program that converts a binary number to decimal. *
%* Input: A binary number (int) *
%* Output: The program will output a integer (number in decimal format) *
%************************************************************************************
var intBinary : int
var intDigit : int
var intPower : int := 0
var intSum : int := 0
put "Please enter a Binary Digit."
get intBinary
loop
intDigit := intBinary mod 10
if intDigit = 1 then
intSum := intSum + (2 ** intPower)
end if
intPower := intPower + 1
intBinary := intBinary div 10
exit when intBinary = 0
end loop
put intSum |
|
|
|
|
|
Sponsor Sponsor
|
|
|
vexd
|
Posted: Mon Sep 29, 2003 11:52 pm Post subject: (No subject) |
|
|
CONVERTOR.u all knew what i meant neways |
|
|
|
|
|
Dan
|
Posted: Tue Sep 30, 2003 4:50 pm Post subject: (No subject) |
|
|
dan's coverting bi to dec code
code: |
put strint("101001",2)
|
wow that was simple eh? |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
vexd
|
Posted: Tue Sep 30, 2003 8:12 pm Post subject: (No subject) |
|
|
O M G |
|
|
|
|
|
|
|