using System; namespace Program { class Program { static void Main(string[] args) { string binary1, binary2; int product = 0; Console.Write("Enter first binary number: "); binary1 = Console.ReadLine(); Console.Write("Enter second binary number: "); binary2 = Console.ReadLine(); int a = Convert.ToInt32(binary1, 2); int b = Convert.ToInt32(binary2, 2); product = a * b; Console.WriteLine("\nDecimal: {0} ", product + " \nBinary: " + Convert.ToString(product, 2).PadLeft(8, '0')); Console.ReadLine(); } } }
Output