I am trying to write a program which counts and print the numbers of each character in a string input by the console.
Example: If the following string is given as input to the program:
abcdefgabc
Then, the output of the program should be:
a,2
c,2
b,2
e,1
d,1
g,1
f,1
Please provide the code for this