Sum method (with integers)

Description

The Sum method calculates the total for a numeric sequence.

Sample

This sample calculates the sum for a list of integers.

var data := List<int>{} { 5, 3, 1, 2, 4 }

var result := data:Sum()

Console.WriteLine(result)

Output

15

Complete sample

using System
using System.Linq
using System.Collections.Generic

procedure Execute() as void strict

   var data := List<int>{} { 5, 3, 1, 2, 4 }

   var result := data:Sum()

   Console.WriteLine(result)
   return