Binary To Decimal Covertor
Author |
Message |
vexd
![](http://us.i1.yimg.com/us.yimg.com/i/mo/hellboy50.jpg)
|
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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
vexd
![](http://us.i1.yimg.com/us.yimg.com/i/mo/hellboy50.jpg)
|
Posted: Mon Sep 29, 2003 11:52 pm Post subject: (No subject) |
|
|
CONVERTOR.u all knew what i meant neways ![Wink Wink](http://compsci.ca/v3/images/smiles/icon_wink.gif) |
|
|
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
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? ![Laughing Laughing](http://compsci.ca/v3/images/smiles/icon_lol.gif) |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
vexd
![](http://us.i1.yimg.com/us.yimg.com/i/mo/hellboy50.jpg)
|
Posted: Tue Sep 30, 2003 8:12 pm Post subject: (No subject) |
|
|
O M G |
|
|
|
|
![](images/spacer.gif) |
|
|