Probably you meant something like:
#include <iostream>
void input(int a[],int size);
int repetitions(int a[], int size, int value);
void print(int a[], int size, int i);
using namespace std;
int main()
{
int size=5, array[size];
cout << "Enter 5 numbers :" << endl;
input(array,size);
for (int j=0;j<size ;j++)
{
print(array, size,j);
}
return 0;
}
void input(int a[],int size)
{
for (int i=0;i<size;i++)
{
cin >> a[i];
}
}
int repetitions(int a[], int size, int value)
{
int count = 0;
for (int n=0; n<size; ++n)
{
if ( a[n] == value) count++;
}
return count;
}
void print(int a[], int size, int i)
{
cout << "The element " << a[i] <<" is repeated for " << repetitions(a,size,a[i]) << " times " << endl;
}
or
#include <iostream>
#include <array>
#include <algorithm>
using namespace std;
int main()
{
const int SIZE = 5;
array<int,SIZE> ar;
cout << "please enter 5 numbers " << endl;
for (auto & a : ar)
cin >> a;
for (auto a : ar)
cout << "item " << a << " is repeated for " << count( ar.begin(), ar.end(), a) << " times" << endl;
}