First of all use int main( void ) and not just main( ) since its not standard.
Don't hard code values in your program, if you want to process 20 values make a preprocessor defination at the start of your program which can easily be modified if you are asked to change the requirements. Using magic numbers as such causes a lot of confusion.
Can you give us a sample run or a dummy example of what kind of output you are expecting ? Are you required to store the occurances or just display them?
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
Offline 8,871 posts
since Jun 2006