Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
decimal to multiple 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; namespace cstack { public class Program { class cstack { public static void Main(string[] args) { int num, baseNum; Console.Write("Enter a decimal number: "); num = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter a base: "); baseNum = Convert.ToInt32(Console.ReadLine()); Console.Write(num + " converts to "); MulBase(num, baseNum); Console.WriteLine(" Base " + baseNum); Console.Read(); } static void MulBase(int n, int b) { Stack Digits = new Stack(); do { Digits.Push(n % b); n /= b; } while (n != 0); while (Digits.Count > 0) Console.Write(Digits.Pop()); } } } }
run
|
edit
|
history
|
help
0
Time diff with date list
EFCXAXS
adcsasxsd
tokenExchange
algo1
HourCouter
Creating async methods in C# prior to version 5.0
prime number experiment
Herencias
Palindrome Number