Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that reads integers, finds the smallest of them and counts its o

ID: 3632288 • 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.

Explanation / Answer

#include int main() { int A[10],min=9999,count=0,i;//Change the size of Array according to you and //initialized min with maximum possible value in your array for(i=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote