---
title: "Array in c#."  
description: "Array in c#."  
author: "Anonymous User"  
published: 2015-11-03  
updated: 2015-11-03  
canonical: https://www.mindstick.com/forum/33566/array-in-c-sharp  
category: ".net"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Array in c#.

How to use [array in c#](https://www.mindstick.com/forum/222/how-do-i-set-negative-number-to-index-of-array-in-c-sharp).

## Replies

### Reply by Anonymous User

Arrays are used to store data of our applications. We declare arrays to be of a certain data type. We specify their length. And we initialize arrays with data. We have several methods for working with arrays. We can modify the elements, sort them, copy them or search for them.

```
using System;using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
namespace Forum
{
  public class ChildClass
    {      static void Main(string[] args)
        {
            int[] array = new int[5];

            array[0] = 1;
            array[1] = 2;
            array[2] = 3;
            array[3] = 4;
            array[4] = 5;
            Console.WriteLine("Show  Array Numbers");
            for (int i = 0; i < array.Length; i++)
            {
                Console.WriteLine(array[i]);
            }
            string[] names = { "ashish", "Tarun", "Pawan", "David" };
            Console.WriteLine("Show Array Name");
            Console.WriteLine(names[0]);
            Console.WriteLine(names[1]);
            Console.WriteLine(names[2]);
            Console.WriteLine(names[3]);
            Console.ReadLine();
        }
    }
}
```

```

```


---

Original Source: https://www.mindstick.com/forum/33566/array-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
