C# - Convert decimal value of integer type to binary value of string type


/ Published in: C#

Microsoft Official Documentation:
https://msdn.microsoft.com/en-us/library/8s62fh68(v=vs.110).aspx


Copy this code and paste it in your HTML
  1. int DecimalValue;
  2. string ValueInBinary;
  3. ValueInBinary= Convert.ToString(DecimalValue, 2); //DecimalValue in integer type is converted to a string in binary - base of 2 form 'ValueInBinary'

URL: https://msdn.microsoft.com/en-us/library/8s62fh68(v=vs.110).aspx

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.