Print Contents of Array Horizontally using C#

 
Code
 
The following code snippet is print contents of array horizontally using C#
  1. using System;  
  2.   
  3. public class Program  
  4. {  
  5.     public static void Main()  
  6.     {  
  7.         string[] array = new string[4];  
  8.         array[0] = "Welcome";  
  9.         array[1] = "to";  
  10.         array[2] = "C#";  
  11.         array[3] = "Corner";  
  12.         foreach (var data in array)  
  13.         {  
  14.             Console.Write(data + " ");  
  15.         }  
  16.     }  
  17. }  
Output
 
Welcome to C# Corner 
 
Demo : https://dotnetfiddle.net/nieFq9#