C Code Help!!! Write a function that prints all the unique values in an array an
ID: 646514 • Letter: C
Question
C Code Help!!!
Write a function that prints all the unique values in an array and the number of times each value occurs.
Below is an output sample. The function takes as parameters the array name and its size. The
C Code Help!!! Write a function that prints all the unique values in an array and the number of times each value occurs. Below is an output sample. The function takes as parameters the array name and its size. The ??main?? function should declare the array and fills it with random numbers that are between 0 and 10. Write your program using the symbolic constant ??SIZE?? so that your code can be used for any size array simply by changing ??SIZE?? on top of the code.Explanation / Answer
#include #define sizea 100 int num[sizea]; int cnt[sizea]; int cmpfunc (const void * a, const void * b); int main(void) { int a[sizea]={1,3,6,8,3,6,7,4,6,9,0,3,5,12,65,3,76,5,3,54, 1,3,6,89,3,6,7,4,6,9,0,4,5,12,65,3,76,5,3,54, 1,9,6,8,3,45,7,4,6,9,0,89,5,12,65,3,76,5,3,54, 6,3,6,8,3,6,7,4,6,9,0,23,5,12,65,3,76,5,3,54, 1,3,6,90,3,6,7,4,6,9,0,5,5,12,65,3,76,5,3,54}; int i, j, ncount; for(i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.