4
Reply

How to show results horizontally

Khoi

Khoi

Oct 31 2009 6:32 AM
3.1k
Below is my code and I expect the numbers show horizontally, but they show vertically. Please advise. Thanks

{
    class Program
    {
        static void Main(string[] args)
        {
            int[] Array1 = { 2, 3, 4 };
            int[] Array2 = { 1, 2, 3 };
            int[] Array3 = new int[3];


  
                Console.WriteLine("\n The Contents of Array1 is: ");
                for (int i = 0; i < 3; i++)
                {
                    Console.WriteLine("{0} \t", Array1[i]);
                }
                Console.WriteLine("\n The Contents of Array2 is: ");
                for (int i = 0; i < 3; i++)
                {
                    Console.WriteLine("{0} \t", Array2[i]);
                }
   
      
            for (int i = 0; i < 3; i++)
            {
                Array3[i] = Array1[i] - Array2[i];
            }

                Console.WriteLine("\n The result of sub is : ");
                for (int i = 0; i < 3; i++)
                {
                    Console.WriteLine("{0} \t", Array3[i]);
                }
               
           
            Console.ReadLine();
        }
    }
}

Answers (4)