Program C Program 8 Builds Frequency Array Discussion Algorithm Noted Potential Problem Oc Q37181247

PROGRAM IN C

Program 8 builds a frequency array. In the discussion of thealgorithm, we noted that a potential problem occurs if any of thedata are invalid.

Write a Frequency and Histogram program that uses the randomnumber generator, rand, to:

▪ Generate 100 numbers between 1 and 22.

▪ The array is then to be passed to a modified version ofprogram 8  that will count the number of values between 0and 19.

▪ Add a 21st element in the array to count all numbers not inthe valid range (0 to 19).

▪ Print the input data in a 20 X 5 array-that is, 20 numbers infive rows.

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.