Print list c#

Choose Category

Printing the values from LIST in C#

  1. Forget Code
  2. C#
  3. Printing the values from LIST
Using foreach, we can print the vales of a List.

using System; using System.Collections.Generic; namespace forgetCode { class program { public static void Main() { List<int> list = new List<int>(); list.Add(1); list.Add(2); list.Add(3); list.Add(4); foreach (int i in list) { Console.WriteLine(i); } } } }


Output:

1
2
3
4

Tags for Printing the values from LIST in C#

  • http://forgetcode.com/CSharp/1187-Printing-the-values-from-LIST
  • how to print lists c
  • c sharp printing values in list
  • understanding the vales of coding
  • print values from list in c
  • print list values c
  • code to print the values in c