Program to find all elements of an array less than 10.

Amatya
Posted by Amatya under LINQ category on | Points: 40 | Views : 131
Program to find all elements of an array less than 10

public void DNF() 
{
int[] dnfNum = { 10, 52, 3, 4, 5, 20, 7, 6, 1, 0, 21,100 };

var dnflowNum =
from n in dnfNum
where n < 10
select n;

Console.WriteLine("Values less then 10-->");
foreach (var x in dnflowNum )
{
Console.WriteLine(x);
}
}


Thanks
Amatya

Comments or Responses

Login to post response