I want you to use C to write me a program with two files to work with a sorted array. One file should just be driver code, another file should be finding the mean, rounded down to an int, of the array, and another should be a function to do a binary search of the array.
system
main chahta hum ki aap si kaa upyog mujhe do filon ke saath ek kaarykram likhane ke liye ek krambaddh sarani ke saath kaam karne ke liye karen.ek fil ko keval driver code hona chahie, ek anya fil ko madhya dhundhna chahie, ek int ke neeche, sarani ke neeche, or doosraa sarani kii ek dwiadhari khoj karne ke liye ek fnction hona chahie.
user
zarur, yah aapke si code ko alag -alag filon main todane ke liye ek acchhee vritti he.yahaan arrlib.c he, jisamen driver code hota he or isamen anya filon main kaaryon ke saath hamen link karne ke liye header filein shaamil hai:

#include <stdio.h>
#include <stdlib.h>

#include "mean.h"
#include "binsearch.h"

#DEFINE ARR_LENGTH 20

mukhya pravesh bindu() {
    int * arr = malloc (sizeof (int) * arr_length);

    // ek udhaaharan ke rup main, ham arohi bhi sankhyaon ke saath sarani bharenge.
    for (int i = 0; i <arr_length; i ++) {
        arr [i] = (i * 2);
    }

    // sarani print karen.
    for (int i = 0; i <arr_length; i ++) printf ("%d", arr [i]);
    printf ("\ n");

    // 19 ko lautnaa chahie.
    printf ("matlab: %d \ n", madhya (giraftaar, arr_length));

    // ko suchakank 6 lautnaa chahie.
    printf ("lakshya suchakank: %d \ n", bin_search (arr, arr_length, 12));

    mukt (giraftaar);
    ritern 0;
}

mean.h or binsearch.h prayek keval kaaryon ko paribhaashit karata he.matlab main.
int mean (int *arr, int len);

Binsearch.h main:
int bin_search (int *arr, int len, int lakshya);

ek hi naam ke saath .c filein hai, jo kaaryon ke karyanvayan ke liye ghar hai.yahan madhya he. si:
int mean (int *arr, int len) {
    int sum = 0;
    for (int i = 0; i <len; i ++) {
        SUM += arr [i];
    }
    // purnank prabhag
    vaapasi yoga / len;
}

yahan binsearch.c he:
int bin_search (int *arr, int len, int lakshya) {
    int l = 0;
    int r = len - 1;
    int mid = (l + r) / 2;
    jabaki (l <= r) {
        //mila:
        if (giraftaar [mid] == lakshya) madhya lauten;
        // sankhya bahut badi he:
        or agar (giraftaar [madhya]> lakshya) r = mid;
        // sankhya bahut choti he:
        el = mid + 1;
        // hamaare nae baayen or daaen binduon ke saath madhya riset karen.
        mid = (l + r) / 2;
    }
    //-1 ingit karata he ki tatv nahin paaya gaya tha.
    vaapasi -1;
}

GCC ke saath sankalit karne ke liye: gcc arrlib.c mean.c binsearch.c
assistant
<|system|>
</s>
<|user|>
main chahta hum ki aap si kaa upyog mujhe do filon ke saath ek kaarykram likhane ke liye ek krambaddh sarani ke saath kaam karne ke liye karen.ek fil ko keval driver code hona chahie, ek anya fil ko madhya dhundhna chahie, ek int ke neeche, sarani ke neeche, or doosraa sarani kii ek dwiadhari khoj karne ke liye ek fnction hona chahie.</s>
<|assistant|>
zarur, yah aapke si code ko alag -alag filon main todane ke liye ek acchhee vritti he.yahaan arrlib.c he, jisamen driver code hota he or isamen anya filon main kaaryon ke saath hamen link karne ke liye header filein shaamil hai:

#include <stdio.h>
#include <stdlib.h>

#include "mean.h"
#include "binsearch.h"

#DEFINE ARR_LENGTH 20

mukhya pravesh bindu() {
    int * arr = malloc (sizeof (int) * arr_length);

    // ek udhaaharan ke rup main, ham arohi bhi sankhyaon ke saath sarani bharenge.
    for (int i = 0; i <arr_length; i ++) {
        arr [i] = (i * 2);
    }

    // sarani print karen.
    for (int i = 0; i <arr_length; i ++) printf ("%d", arr [i]);
    printf ("\ n");

    // 19 ko lautnaa chahie.
    printf ("matlab: %d \ n", madhya (giraftaar, arr_length));

    // ko suchakank 6 lautnaa chahie.
    printf ("lakshya suchakank: %d \ n", bin_search (arr, arr_length, 12));

    mukt (giraftaar);
    ritern 0;
}

mean.h or binsearch.h prayek keval kaaryon ko paribhaashit karata he.matlab main.
int mean (int *arr, int len);

Binsearch.h main:
int bin_search (int *arr, int len, int lakshya);

ek hi naam ke saath .c filein hai, jo kaaryon ke karyanvayan ke liye ghar hai.yahan madhya he. si:
int mean (int *arr, int len) {
    int sum = 0;
    for (int i = 0; i <len; i ++) {
        SUM += arr [i];
    }
    // purnank prabhag
    vaapasi yoga / len;
}

yahan binsearch.c he:
int bin_search (int *arr, int len, int lakshya) {
    int l = 0;
    int r = len - 1;
    int mid = (l + r) / 2;
    jabaki (l <= r) {
        //mila:
        if (giraftaar [mid] == lakshya) madhya lauten;
        // sankhya bahut badi he:
        or agar (giraftaar [madhya]> lakshya) r = mid;
        // sankhya bahut choti he:
        el = mid + 1;
        // hamaare nae baayen or daaen binduon ke saath madhya riset karen.
        mid = (l + r) / 2;
    }
    //-1 ingit karata he ki tatv nahin paaya gaya tha.
    vaapasi -1;
}

GCC ke saath sankalit karne ke liye: gcc arrlib.c mean.c binsearch.c</s>
