小编Bos*_*ovi的帖子

How many numbers higher than average [C++]

I filled an array with 30 random numbers and calculated average. I want to display how many numbers are higher than the average. I tried making a function "aboveAverage" and check if the numbers are higher than the average and than just increase the count "num_over_average++". The problem is I don't know how to pass a value "avg" from function to another function.

#include <iostream>
#include <ctime>
using namespace std;

const int n = 30;

void fillArray(int age[], int n) …
Run Code Online (Sandbox Code Playgroud)

c++ arrays numbers average

5
推荐指数
1
解决办法
162
查看次数

标签 统计

arrays ×1

average ×1

c++ ×1

numbers ×1