Return to Snippet

Revision: 2693
at March 27, 2007 19:22 by rengber


Updated Code
//To Binary from Integer
int startVal = 7; 
int base = 2; 
string binary = Convert.ToString(startVal, base); 

//To Integer From Binary
string binary = "111";
int base = 2; 
int integer = Convert.ToInt32(binary, base);

Revision: 2692
at March 27, 2007 19:21 by rengber


Initial Code
//To Binary from Integer
int startVal = 7; 
int base = 2; 
string binary = Convert.ToString(startVal, base); 

//From Binary to Integer
string binary = "111";
int base = 2; 
int integer = Convert.ToInt32(binary, base);

Initial URL

                                

Initial Description

                                

Initial Title
Converting Integers To and From Binary

Initial Tags

                                

Initial Language
C#