Open In App

C# Program to Print the Numbers Greater Than 786 in an Integer Array using LINQ

Last Updated : 19 Dec, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

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.

Example: 

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

Approach: 

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.

Example:

Output:

The numbers larger than 786 are :
789 987 

Article Tags :

Similar Reads