using System; class MaxOccurringChar { static void Main() { Console.Write("Enter a string: "); string str = Console.ReadLine(); int[] freq = new int[256]; foreach (char c in str) freq[c]++; int max = 0; char result = ' '; foreach (char c in str) { if (freq[c] > max) { max = freq[c]; result = c; } } Console.WriteLine($"Maximum occurring character: {result}"); } }