using System.Collections.Generic;
public static void Main()
string Word = "He is the masters in the technology";
var Value = Word.Split(' ');
Dictionary<string, int> RepeatedWordCount = new Dictionary<string, int>();
for (int i = 0; i < Value.Length; i++)
if (RepeatedWordCount.ContainsKey(Value[i]))
int value = RepeatedWordCount[Value[i]];
RepeatedWordCount[Value[i]] = value + 1;
RepeatedWordCount.Add(Value[i], 1);
Console.WriteLine("------------------------------------");
Console.WriteLine("Repeated words and counts");
foreach (KeyValuePair<string, int> kvp in RepeatedWordCount)
Console.WriteLine(kvp.Key + " Counts are " + kvp.Value);