C# Program to Print the Numbers Greater Than 786 in an Integer Array using LINQ
Language-Integrated Query (LINQ) is a uniform query syntax in C# to retrieve data from different sources. It eliminates the mismatch between programming languages and databases and also provides a single querying interface for different types of data sources. In this article, we will learn how to display numbers greater than 786 in an array using LINQ.
Input: 1, 234, 456, 678, 789, 987, 654, 345 Output: 789, 987 Input: 3, 134, 856, 578, 789, 187, 854, 945 Output: 856, 854, 945
To print the numbers greater than 786 in an integer array we use the following approach:
- Store integer(input) in an array.
- By using the LINQ query we will store the numbers greater than 786 in an iterator.
- Now the iterator is iterated and the integers are printed.
The numbers larger than 786 are : 789 987