THIS IS MY QUESTION........PLEASE SOLVE IT...........

Write a complete program to read 15 numbers type of integer and calculate the number of the same number. (Use : loop, array, function)

Example:
Please enter 15 numbers :
2 4 5 6 2 2 7 5 5 2 2 2 4 4 6

Number of 2 appear 6 times
Number of 4 appear 3 times
Number of 5 appear 3 times
Number of 7 appear 1 time

I HOPE YOU ALL CAN SOLVE IT.............

Recommended Answers

All 2 Replies

Yes, we all can solve it.
The question is, are you going to attempt it yourself first?

That's what the intro thread tells you.

As Edward said in PM, here's a hint:

Use two arrays: one to store the numbers and one to store the numbers that have been counted. As you loop through the numbers, look for the current number in the counted array. If it's not there, add it and then count the current number. If it is there, ignore the current number and go to the next one.

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.