How to set binary value to int variable in C#

1 Answer

0 votes
using System;

public class Example
{
	public static void Main(string[] args)
	{
		int bin = 0b11111;

		Console.WriteLine(bin);
	}
}




/*
run:
 
31
 
*/

 



answered Jul 31, 2022 by avibootz

Related questions

1 answer 230 views
1 answer 243 views
243 views asked Jul 31, 2022 by avibootz
1 answer 245 views
1 answer 274 views
1 answer 242 views
1 answer 277 views
1 answer 273 views
...