bit representation of a number

  • Thread starter Thread starter William Stacey [MVP]
  • Start date Start date
W

William Stacey [MVP]

int i = 4390;
string base2String = Convert.ToString(i, 2);
Console.WriteLine(base2String);

or use a hashtable.
 
Is there way to convert an int or byte into a string representation of its
bits. For example, an int with a value of 7 would be displayed as "0111".

Thanks for helping.
 
Back
Top