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 ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> numb = new List<int> { 1, 5, 7, 19 };
- for (int i = 0; i < numb.Count; i++)
- {
- numb.Select(x => Calc(numb[i]));
- }
- foreach (var item in numb)
- {
- Console.WriteLine(item);
- }
- }
- private static int Calc(int x)
- {
- return x + 5;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment