You are viewing a single comment's thread. Return to all comments →
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); }
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
Here is the solution in C: