(C programing) 2. Write a program that populates an array with 20 random integer
ID: 3676792 • Letter: #
Question
(C programing)
2. Write a program that populates an array with 20 random integers between 1 - 100. The program must traverse through the array and determine how many times each integer was generated. Use a second array of size 101 to keep track of the number of times each integer was generated. Initialize each item in the second array to 0. For each item in the first array, use it as the index into the second array and increment the contents found in the second array at the corresponding index. Note: for this problem we are willing to trade memory efficiency (the second array is mostly unused) for time efficiency. We know indexing into an array is very efficient.
(I need both main.c function.c and hearder.h if you use three file format)
Explanation / Answer
# include < stdio.h>
#include < conio.h>
#include <stdlib.h>
}
{
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.