22
1
using System;
2
using System.Linq;
3
4
namespace ConsoleApplication1
5
{
6
public class Program
7
{
8
public static void Main(string[] args)
9
{
10
string[] employeesInDeptA = { "Asutosh", "Kapil", "Sumit", "Rajat" };
11
string[] employeesInDeptB = { "Preeti", "Sumit", "Kanupriya", "Kapil" };
12
13
var result = employeesInDeptA.Intersect(employeesInDeptB);
14
15
Console.WriteLine("Common Employees in Department A and B:");
16
foreach (var item in result)
17
{
18
Console.WriteLine(item);
19
}
20
}
21
}
22
}
Cached Result
2025062913:25:49
2025062911:00:00
2025062911:00:00
Executa
2025062911:00:00
2025062911:00:00
Executa