Just to be different from CPallini:
public static void Main()
{
string a = "DEXWRXWXQOX";
Dictionary<char, bool> odd = new Dictionary<char, bool>();
foreach (char c in a)
{
bool codd;
odd[c] = odd.TryGetValue(c, out codd) && !codd;
}
foreach (char c in odd.Keys)
Console.WriteLine("{0} occurrences number is {1}. ", c, odd[c] ? "odd" : "even");
}
OR
private static readonly string[] EO = new string[] { "even", "odd" };
public static void Main()
{
string a = "DEXWRXWXQOX";
Dictionary<char, int> counts = new Dictionary<char, int>();
foreach (char c in a)
{
int n;
counts.TryGetValue(c, out n);
counts[c] = n + 1;
}
foreach (char c in counts.Keys)
Console.WriteLine("{0} occurrences number is {1}. ", c, EO[counts[c] & 1]);
}