Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Binary To Decimal Covertor
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
vexd




PostPosted: 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
Sponsor
sponsor
vexd




PostPosted: Mon Sep 29, 2003 11:52 pm   Post subject: (No subject)

CONVERTOR.u all knew what i meant neways Wink
Dan




PostPosted: 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
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
vexd




PostPosted: Tue Sep 30, 2003 8:12 pm   Post subject: (No subject)

O M G
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: