Please tell me how to write a program which finds the frequency of each digit of an enterd number.
Eg- if i enter 1112245 the output should come out to be 'Frquency of 1 is 3' 'Frequency of 2 is 2' 'Frequency of 4 is 1' 'Frequency of 5 is 1'.
Plz keep the data type as integer or long.
Lmbcabhi 0 Newbie Poster
Recommended Answers
Jump to PostDaniWeb Member Rules (which you agreed to when you signed up) include:
"Do provide evidence of having done some work yourself if posting questions from school or work assignments"
http://www.daniweb.com/community/rulesPost what you have done so far and someone will help you from there.
Jump to PostThe code looks to be on the right track.
A few remarks... I wouldn't bother converting to an integer as it is useless, unless you actually want to do some math with it.
Look at how a letter frequency counter would be implemented... This is a big clue.
Keep the …
All 8 Replies
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Lmbcabhi 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

iamthwee
mishalparmar 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Yetzederixx 0 Newbie Poster
somjit{} 60 Junior Poster in Training Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.