Program to count the frequency of each character for a given string

Let’s see a program to count the frequency of each character for a given string.

Output is :-

b —- 1
a —- 2
n —- 1
g —- 1
l —- 1
o —- 1
r —- 1
e —- 1

Top