You are viewing a single comment's thread. Return to all comments →
void plusMinus(int arr_count, int* arr) { int neg_count = 0, zero_count = 0, pos_count = 0; for (int i = 0; i < arr_count; ++i) { if (arr[i] > 0) ++pos_count; else if (arr[i] < 0) ++neg_count; else ++zero_count; } printf("%.6f\n", (float)pos_count / arr_count); printf("%.6f\n", (float)neg_count / arr_count); printf("%.6f\n", (float)zero_count / arr_count); }
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 →