Answer:
using System;
using System.Collections.Generic;
using System.Linq;
public class Problem1 {
public static IEnumerable < int > myFilter(IEnumerable < int > input) {
return input.Where((val, index) => {
//First remove all multiples of 6 less than 42
return !(val % 6 == 0 && val < 42);
}).Select((val, index) => {
//Then square each number
return val * val;
}).Where((val, index) => {
// Finally, remove any resulting integer that is odd
return !(val % 1 == 0);
});
}
public static void Main(string[] args) {
Random rnd = new Random(5);
//Takes a sequence of integers with values from 0 to 100
var listForProblem = Enumerable.Range(1, 100).Select(i => rnd.Next() % 101);
var answer = Problem1.myFilter(listForProblem);
foreach(int i in answer) {
Console.WriteLine(i);
}
}
}
Explanation:
The Problem 1 solution is explanatory enough.
Your problem 2 question is lacking details. However, i have written a code that sorts it.