using System;class Count {public static void Main(){String str = "ABCdefg123@#";int upper = 0, lower = 0;int number = 0, special = 0;for(int i = 0; i < str.Length; i ){char ch = str[i];if (ch >= 'A' && ch <= 'Z')upper ;else if (ch >= 'a' && ch <= 'z')lower ;else if (ch >= '0' && ch <= '9')number ;elsespecial ;}Console.WriteLine("Upper case letters : " upper);Console.WriteLine("Lower case letters : " lower);Console.WriteLine("Number : " number);Console.Write("Special characters : " special);} }