using System;
namespace binary
/*
input
57
output
00111001
input
47
output
00101111
*/
{
class DecimalToBinary
{
static void Main(string[] args)
{
Console.Write("Decimal: ");
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 number= ");
for(i=i-1 ;i>=0 ;i--)
{
Console.Write(a[i]);
}
}
}
}
int
Convert.ToString(n, 2)
.