Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Example1
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Populates the 'values' list
- for (int i = 0; i < 10; i++)
- values.Add(i);
- Console.WriteLine(getSum);
- }
- static List<double> values = new List<double>();
- static double getSum
- {
- get
- {
- double sum = 0;
- foreach(double d in values)
- {
- sum += d;
- }
- return sum;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement