How to count array elements in C#

1 Answer

0 votes
using System;
using System.Linq;

class Program
{
    public static void Main()
    {
        string[] arr = {"c#", "c", "c++", "python", "php"};
      
        Console.WriteLine(arr.Count());
    }
}




/*
run:

5

*/

 



answered Nov 1, 2020 by avibootz

Related questions

1 answer 144 views
1 answer 140 views
1 answer 159 views
2 answers 162 views
1 answer 118 views
1 answer 174 views
1 answer 157 views
...