Hi guys, ive tried to implement an array to find out the occurence of a single number, im stuck because i dont know how to display the number and its frequency in the output. Ive searched the board but it only mentions using 2d arrays and stuff.

Thanks

Code:

/* Write a program that reads in some integer values,
* and counts the frequency of each value in the input
*/
#include <stdio.h>
#define SIZE 1000
int values_array( int [], int );
void calc_freq( int [], int );
void print_array( int [], int );
int main()
{
int numbers[SIZE], values, freq;
values = values_array( numbers, SIZE );
printf( "Numbers Entered: " );
print_array( numbers, values );
calc_freq( numbers, values );
printf( "%4s%17s\n", "Number", "Frequency" );
print_array( numbers, values );
return 0;
}
int values_array( int A[], int size )
{
int num, n=0;
printf( "Enter some numbers, crtl-D to end: " );
while ( scanf("%d", &num ) == 1 ) {
A[n] = num;
n++;
}
return n;
}
void calc_freq( int A[], int n )
{
int i, j;
for ( i = 0; i<n ; i++ )
for ( j =i+1; j< n; j++ ) {
if (A[i] == A[j])
++A[i];
}
}
void print_array( int A[], int n )
{
int i;
for ( i = 0; i < n; i++ ) {
printf( "%3d", A[i] );
}
}