Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
decimal to binary conversion
//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) { //binary equivalent of a decimal number int num = 10; Console.WriteLine("The binary equivalent for the number {0} is :" , num); binaryconversion(num); } public static int binaryconversion(int num) { int b; if (num != 0) { b = (num % 2) + 10 * binaryconversion(num / 2); Console.Write(b); return 0; } else { return 0; } } } }
run
|
edit
|
history
|
help
0
from Base or Derived
ShortBubbleSort
Hello World!
Random Number Generation
Basic
out parameters
עעעע
Gamez
adxcsdxsddxsd
1234