In LINQ, you can find the sum of the given numeric elements by using the Sum() method. This method calculates the sum of the numeric value present in the given sequence. It does not support query syntax in C#, but it supports in VB.NET. It is available in both Enumerable and Queryable classes in C#. It can work with nullable, non-nullable decimal, double, floats, int, etc. values.
The Sequence is: 20 30 50 78 90 79 89 99 97 29 The sum of the given sequence is: 661
Total salary of the Employees: 220000
- LINQ | How to find average of the given sequence?
- LINQ | How to find minimum value of the given sequence?
- LINQ | How to find maximum value of the given sequence?
- LINQ | How to find aggregate of the given sequence?
- Count the number of element present in the sequence in LINQ?
- What is Query in LINQ?
- LINQ | Set Operator | Except
- LINQ | Let Keyword
- LINQ | Set Operator | Union
- LINQ | Partition Operator | Take
- LINQ | Method Syntax
- Aggregation Function in LINQ
- LINQ | Set Operator | Intersect
- LINQ | Quantifier Operator | Contains
- LINQ | Element Operator | First
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.