Thursday, 15 October 2015

Assign value to array at the time of Declaration and Accessing array element in C#

using System;
    class Program
    {
        static void Main(string[] args)
        {
            int[] testarray = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            for (int i = 0; i < testarray.Length; i++)
            {
                Console.Write(testarray[i]+"\t");
            }
            Console.WriteLine("\n");
        }
    }

No comments:

Post a Comment