Answered You can hire a professional tutor to get the answer.

QUESTION

Which of the following will correctly calculate the average of the elements included in the nums array?

Which of the following will correctly calculate the average of the elements included in the nums array?a) while (x < 4){nums[x] = total + total;x += 1;} //end whileavg = static_cast<double>(total) / static_cast<double>(x);b) while (x < 4){total += nums[x];x += 1;} //end whileavg = static_cast<double>(total) / static_cast<double>(x);c) while (x < 4){total += nums[x];x += 1;} //end whileavg = static_cast<double>(total) / static_cast<double>(x)-1;d) while (x < 4){total += nums[x];x += 1;} //end whileavg = static_cast<double>(total) / static_cast<double>(x-1);

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question