बिजनेस मार्केटिंग का लो कॉस्ट फंडा , अपने मोबाइल से ऑटो sms भेजकर मार्केटिंग करे विजिट करे http://autotextsms.com/ बिजनेस मार्केटिंग का लो कॉस्ट फंडा http://autotextsms.com/

Search This Blog

Translate

Showing posts with label C Program to print all repeated numbers with frequency in an array. Show all posts
Showing posts with label C Program to print all repeated numbers with frequency in an array. Show all posts

C Program to print all repeated numbers with frequency in an array

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
----------------------------



  • 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 example List