Print list c#
Ngày đăng:
17/02/2022
Trả lời:
0
Lượt xem:
210
Choose Category Printing the values from LIST in C#
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#
|