Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
decimal to binary
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int num; Console.Write("Enter a Number : "); num = int.Parse(Console.ReadLine()); int quot; string rem = ""; while (num >= 1) { quot = num / 2; rem += (num % 2).ToString(); num = quot; } string bin = ""; for (int i = rem.Length - 1; i >= 0; i--) { bin = bin + rem[i]; } Console.WriteLine("The Binary format for given number is {0}", bin); Console.Read(); } } }
run
|
edit
|
history
|
help
1
Covariance & Contravariance
sdfrgthyjuytrfdf
CommandForce1
Games
k
Q: Why this calling base class virsion?
CommandForce3
custom stack Implementation
database exterior 0.1
circl