0

First time C# user here. I'm trying to flesh out my use with C# tools that are built into the language and I was wondering if there was any other tools to convert between bases that are not of 2, 8, 10, and 16.

Here is some sample code I have done already.

Console.Write("\nEnter in a number in Base 10 to be converted: ");
base10 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("-------------------------------------------------");

Console.WriteLine("The first number in base 2 is: {0}", Convert.ToString(base10, 2));
Console.WriteLine("The first number in base 8 is: {0}", Convert.ToString(base10, 8));
Console.WriteLine("The first number in base 16 is: {0}", Convert.ToString(base10, 16));
Console.WriteLine("-------------------------------------------------");

What I would like to know, are there any built in tools to convert to bases that are not 2, 8, 10, and 16? For example 5, 7, and 9? I've been looking all around the Internet and I haven't been able to find an answer for this question.

juharr
  • 31,741
  • 4
  • 58
  • 93

0 Answers0