How to create new array in C#

1 Answer

0 votes
using System;

public class Program
{
    public static void Main()
    {
        int[] arr = new int[10];
        
        for (int i = 0; i < 10; i++) {
            Console.WriteLine("{0}: - {1}", i, arr[i]);
        }
    }
}




/*
run:

0: - 0
1: - 0
2: - 0
3: - 0
4: - 0
5: - 0
6: - 0
7: - 0
8: - 0
9: - 0

*/

 



answered Apr 18, 2022 by avibootz

Related questions

1 answer 162 views
1 answer 196 views
2 answers 187 views
1 answer 181 views
2 answers 277 views
...