By: Editorial Staff | Last Updated:
This is a simple C# program to convert decimal to binary number. If you are a c# beginner or want to start learning the c# programming language, then this program will help you to understand the basics of c# programming. In this program, I will explain how to write a c# program to convert decimal to binary number.
Copy the below c# program and execute it in your Microsoft Visual Studio IDE (Integrated Development Environment ). At the end of this program, I have shared the output of program this program.
public class ConversionExample
public static void Main(string args)
int n, i;
int a = new int;
Console.Write("Enter the number to convert: ");
for(i=0; n>0; i++)
Console.Write("Binary of the given number= ");
for(i=i-1 ;i>=0 ;i--)
Enter the number to convert:9
Binary of the given number= 1001
Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari View all posts by Editorial Staff
Tags: convert decimal fraction to binary number, convert decimal to binary number, convert decimal to binary number 75, convert decimal to binary number in c#, convert decimal to binary number system, convert negative decimal to binary number