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
show the date
sdf
2
any predicate test
CommandForce2
Matrix Pattern
Test
0/1 Knapsack problem using Iterative Approach
UPDJLJ87258 Orderby grouping understanding
ConcurrentDictionary<T>