c# code to convert decimal to binary
int n, i;
int[] a = new int[10];
Console.Write("Enter the number to convert: ");
n= int.Parse(Console.ReadLine());
for(i=0; n>0; i++)
{
a[i]=n%2;
n= n/2;
}
Console.Write("Binary of the given number= ");
for(i=i-1 ;i>=0 ;i--)
{
Console.Write(a[i]);
}
Also in C#:
- c# return two variables of different types
- how to check if an integer is in array c#
- c# stop loop in method
- get setter c# model
- parse strings into words C#
- how to clear console through script unity
- c# how to open file explorer
- c# create new thread
- how to convert a number to 2 decimal places in c#
- c# iorderedenumerable to dictionary
- change text color wpf
- asp.net tag helper checkbox
- unity multiplayer
- response redirect new tab
- hasmap c#
- c# how to refresh your binding source
- c# inotifypropertychanged best practices
- exception handling c# stack overflow
- write string multiple times c#
- f string C#
- c# get gridview DataKeyNames
- c# loop through two dimensional array
- .net core cli
- dynamic convert type c#