Answer the question
In order to leave comments, you need to log in
Answer -nan [inf] how to solve?
You need to calculate the geometric mean of the negative elements of the array.
First, I filled the array, counted as many such elements.
double a=0, a1=1;
for (int i=0; i<A;i++){
if ( arrA[i]< 0) {
a = arrA[i];
a1 *= pow(a, 1/k);
}
где k - счётчик отрицательных элементов.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question