c program to find repeated elements in an array
c program to print all the repeated numbers in an array
c program to find maximum repeated number in an array
find the frequency of a number in an array in java
program to find duplicate numbers in an array in java
c program to find frequency of a number
c program to count frequency of each element in an array
write a c program to merge two array to third array
C Program to print all repeated numbers with frequency in an array
#include <stdio.h>
#include <malloc.h>
void duplicate(int array[], int num)
{ int *count = (int *)calloc(sizeof(int), (num - 2));
int i;
printf("duplicate elements present in the given array are ");
for (i = 0; i < num; i++)
{ if (count[array[i]] == 1)
printf(" %d ", array[i]);
else count[array[i]]++; } }
int main()
{ int array[] = {5, 2, 2, 1, 4, 2};
int array_freq = sizeof(array) / sizeof(array[0]); duplicate(array, array_freq); getchar(); return 0; }
OUTPUT:-
----------------------------
duplicate elements present in the given array are 2
----------------------------