generate functionSun, 02 Jul 2023

Hallar la media mediana moda para n datos

#include <iostream> #include <vector> #include <algorithm> using namespace std; float arithmeticMean(vector<float> nums) { float mean = 0; for(float x : nums) { mean += x; } return mean / nums.size(); } int main() { vector<float> v = {4,7,8,9,10}; cout << arithmeticMean(v); }

Questions about programming?Chat with your personal AI assistant