Sei sulla pagina 1di 1

using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int[] misDatos = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0};
var losRegs = from num in misDatos where num < 5 select num;
string valores = "";
MessageBox.Show("misDatos < 5:");
foreach(int elReg in losRegs)
{
valores = valores + elReg.ToString() + "\n";
}
MessageBox.Show(valores);
}
}
}

Potrebbero piacerti anche