Q:

finding how many times an element has repeated in c

I've got a c study which it must print all the numbers in an array then how many times they repeated.
int lottery(int a,int b,int c,int d,int e,int f,int i,int count)
{
    printf("Enter the loop count:");
    scanf("%d",&d);
    a=time(NULL);
    srand(a);
    int genel[100][100];
    int hepsi[50]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49};
    count=0;
    for(e=0;e<=d-1;e++)
    {
       for(b=0;b<=5;b++)
        {
           genel[e][b]=(rand()%49+1);
           while(i>=0 && i<=49)
                {
                  if(genel[e][b]==hepsi[i])
                    {
                        count=count+1;
                    }
                else{
                        count=count;
                    }

                }
           printf("%d->%d\t",genel[e][b],count);
        }
    }

}

This doesnt work obviously. the output must be something like that 
1-->0  2-->3 3-->15 etc
TY for your help, cheers :)

A:

It is important that you understand what you are doing, naming is therefore very important. Nesting loops is okay if you know what you are doing. An easier to understand approach would be:
void lottery() {
    int i, j                  //forloop counters
    int randArray[100][100];  //array for random values

    srand(Time(NULL));        //set random seed based on system time

    //set random values
    for(i = 0; i < 100; i++) {
        for(j = 0; j < 100; j++) {
            randArray[i][j] = rand()%49 + 1; //sets random ranging from 1 to 49 (49 incl)
        }
    }

    //here you can start the counting procedure, which I won't spoil but ill give some hints below

}

There are a few options, first the easy lazy approach:
use a loop over all the values, 'int number' from 1 up to 49, inside that forloop use two forloops to search through the whole array, incrementing int x everytime you encounter the value 'number'. After youve searched through the whole array, you can use printf("%d -> %d", number, x); to print the value, set x to zero and count another number.
Another approach is as u tried,
create an array with for each number a location where you can increment a counter. Loop through the whole array now using two for-loops, increment the arraylocation corresponding to the value which youve found at randArray[i][j]. Afterwards print the array with counts using another forloop.
I suggest you try to clean up your code and approach, try again and come back with problems you encounter. Good luck!
sorry if this wasn't helpful to you, I tried to spoil not too much because according to my own experience programming should be learned by making mistakes.

