# Program that reads integers, finds the smallest of them, and counts its occurrences

• November 26th, 2011, 09:52 AM
deathpain
Program that reads integers, finds the smallest of them, and counts its occurrences
i need help with this homework, i tried to do it many times but still the outputs are wrong,
help is appreciated.

Write a program that reads integers, finds the smallest of them, and counts
its occurrences. Assume that the input ends with number 0. Suppose that
you entered 30 50 20 50 20 50 100 0; the program finds that the smallest is
20 and the occurrence count for 20 is 2.
If the occurrences of the smallest number is greater than 1, print the value
of the number and the number of occurrences. However, if the smallest
number occurrences is equal 1, print only the value of the smallest number.
Note: the occurrences of a number means how many times this number has
been entered in the input.
• November 26th, 2011, 11:13 AM
copeg
Re: Program that reads integers, finds the smallest of them, and counts its occurrenc
Quote:

i tried to do it many times but still the outputs are wrong
We have not clue what you tried, so cannot provide specific guidance. Ask a specific question and your chances of help increase substantially