1 C# Program to Generate Odd Numbers in Parallel using
LINQ
This C# Program Generates Odd Numbers in Parallel using LINQ. Here it Provides a set of
methods for querying objects that implement ParallelQuery{TSource} to generate odd numbers
inparallel.
Here is source code of the C# Program to Generate Odd Numbers in Parallel using
LINQ. The C# program is successfully compiled and executed with Microsoft Visual
Studio. The program output is also shown below.
1 /*
2
* C# Program to Generate Odd Numbers in Parallel using LINQ
*/
4 using System;
5 using [Link];
6 using [Link];
7
8 class Program
9 {
10
static void Main(string[] args)
11
{
IEnumerable<int> oddNums =
12
((ParallelQuery<int>)[Link](20, 2000))
13
.Where(x => x % 2 != 0)
14
.Select(i => i);
15
foreach (int n in oddNums) { [Link](n); }
16
[Link]();
17
18 }