Write a program that reads integers, finds the smallest of them and counts its o
ID: 3632253 • Letter: W
Question
Write a program that reads integers, finds the smallest of them and counts its occurences.
Assume that the input ends with 0. (Hint: Maintain two variables, min and count. Min stores the
current min number, and count stores its occurences. Initially, assign the first number to min and 1
to count. Compare each subsequent number with min. If the number is less than min, assign it to
min and reset count to 1. If the number is equal to min, increment count by 1.)
Ex: Enter integer numbers: 6 2 5 2 2 3 0
The smallest number is 2, its occurrence number is 3.