AD1

Saturday, 16 September 2017

Count frequency of each element in array

Write a program to count the frequency of each element in array , as example if we have 
int a[10]={5, 10, 2, 5, 50, 5, 10, 1, 2, 2};
the output should be 
number     frequency
5          3
10         2
2          3
50         1
1          1

No comments:

Post a Comment