• + 0 comments

    Here is the solution in C:

    void plusMinus(int arr_count, int* arr) {
    double positive=0,negative=0,zero=0;
    for(int i=0;i<arr_count;i++){
        if(arr[i]>0) positive++;
        else if(arr[i]<0) negative++;
        else zero++;
    }
    positive/=arr_count;
    negative/=arr_count;
    zero/=arr_count;
    printf("%.6f\n%.6f\n%.6f",positive,negative,zero);
    }