Converting a Number in Another Base to Base10 : Number : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » Number »

 

Converting a Number in Another Base to Base10









    


using System;
using System.Data;


class Class1{
        static void Main(string[] args){
      string base2 = "111";
      string base8 = "117";
      string base10 = "1110";
      string base16 = "11F1FF";

      Console.WriteLine("Convert.ToInt32(base2, 2) = " + 
        Convert.ToInt32(base2, 2));

      Console.WriteLine("Convert.ToInt32(base8, 8) = " + 
        Convert.ToInt32(base8, 8));

      Console.WriteLine("Convert.ToInt32(base10, 10) = " + 
        Convert.ToInt32(base10, 10));

      Console.WriteLine("Convert.ToInt32(base16, 16) = " + 
        Convert.ToInt32(base16, 16));
        }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» Number