Well, first of all I would make the user input the number as a string or char* . Then I would make two arrays, most likely two-dimensional. In the first dimension of that array, store whatever numbers you found in the input string, but beware of duplicates. In your example, 53100149. So you should have an array that looks like this: { [ 5 , 0 ], [ 3 , 0 ], [ 1 , 0 ], [ 0 , 0 ], [ 4 , 0 ], [ 9 , 0 ] }. Then in the second dimension, you count and store the occurence of each character in the first dimension so it would be like:
{ [ 5 , 1 ], [ 3 , 1 ], [ 1 , 2 ], [ 0 , 2 ], [ 4 , 1 ], [ 9 , 1 ] }
That's how I think you should do it. As for actual code, well trust me it's better to learn it yourself. If you don't understand at all what I'm talking about, you should probably learn the basics first, like arrays, 2D arrays, and string manipulation.