How to print array of strings using for loop in C#

1 Answer

0 votes
using System;
                     
public class Program
{
    public static void Main()
    {
        string[] arr = {"c", "c#", "java", "python", "c++"}; 
          
        int size = arr.Length; 
          
        for (int i = 0 ; i < size; i++) {
           Console.WriteLine(arr[i]);
        }
    }
}
 
 
 
/*
run:
 
c
c#
java
python
c++

*/

 



answered Sep 4, 2021 by avibootz
edited Sep 23, 2021 by avibootz

Related questions

1 answer 204 views
1 answer 172 views
1 answer 176 views
2 answers 249 views
2 answers 256 views
1 answer 110 views
110 views asked Jan 14, 2024 by avibootz
...