Friday, 4 May 2018

Introduction to Array in C#



using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;



namespace array

{

    class Program

    {

        static void Main(string[] args)

        {

            int[] a = new int[3]; //decalaration......

            int[]b = new int[3]{11,32,10,}; //array initialization

            int[] c = new int[] { 32, 43, 65, 76, 34, 32,65 }; //array initialization

            Console.WriteLine("--------Array A-----");



            for (int i = 0; i < a.Length; i++)

            {

                Console.WriteLine(a[i]);

            }

            Console.WriteLine("--------Array B-----");



            int  x = 0;

            while (x<b.Length)

            {

                Console.WriteLine(b[x]);

                x++;

            }

            Console.WriteLine("--------Array c-----");

            foreach (int item in c)

            {

                Console.WriteLine(item);   

            }











            Console.ReadLine();

        }

    }

}


No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...