Dot Net Capsules

A Capsule on .NET, everyday, keeps you .NetHealthy!!!!

My Photo

Programmer. Visit my new blog at

Tuesday, April 26, 2005

Converting an Integer to Binary format

Use Convert.ToString(number, 2) to convert an integer to Binary format.
Following is the sample code:

public string IntToBinary(int num) {
return Convert.ToString(num, 2) ;

when you call this function passing number 3 it will return '11' and when you call this function passing number 300 it will return '100101100'.

So how's that!!!!!!!!!!!


Blogger ArunGG_MVP said...

Cool Buddy :) Keeep your good work

Arun Ganesh

Wed Jan 11, 11:54:00 AM  
Anonymous Anonymous said...

That was good tip.

Wed Mar 25, 01:31:00 AM  
Blogger Karmakul said...

The base of the return value, which must be 2, 8, 10, or 16.

Fri May 22, 11:36:00 AM  

Post a Comment

<< Home

You Visitor Number:
Free Web Site Counter
Free Counter
free counters