Search:

Type: Posts; User: legacye

Search: Search took 0.00 seconds.

  1. Replies
    2
    Views
    1,284

    Numbers in an array

    I need to be able to count the number of occurrances of the numbers 1->9 in the array 'a' and output them in the form

    printf("\n %d occurrs : %d times\n",num,occurrances)

    What do i need to do...
  2. Replies
    6
    Views
    2,195

    Tried the first way...no success

    I tried the total [nums] etc...with and without Salems suggested way and it keeps crashing ...and doesnt count the numbers correctly



    int count_num(int a[], int range, int num)
    /* checks array...
  3. Replies
    6
    Views
    2,195

    no that doesnt work

    i Tried that Salem, but all it does is extend the output past 9 (up to the maximum value in the array)..it doesnt help the functionality of occurrances at all...
  4. Replies
    6
    Views
    2,195

    thanks...but could someone show me how to do that in the header?

    This is the section that does the count work:


    int count_num(int a[], int range, int num)
    /* checks array a for number of occurrances of value */
    {
    int i, count=0;
    for (i=0; i<range;...
  5. Replies
    6
    Views
    2,195

    Count_nums (need help ASAP!)

    Count_nums in an array
    ---------------------------------------------------------
    Hi..i need to get a solution to this pretty trivial problem asap.

    This is a random number generator that has...
Results 1 to 5 of 5