Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
414 B
2
Indexable
Never
#include <iostream>

int main() {
	int nums[10] = {};
	int avg, max_val, min_val, i;

	nums[0] = 10;
	nums[1] = 18;
	nums[2] = 75;
	nums[3] = 0;
	nums[4] = 1;
	nums[5] = 56;
	nums[6] = 100;
	nums[7] = 12;
	nums[8] = -19;
	nums[9] = 88;

	avg = 0;
	for (i = 1; i < 10; ++i) {
		avg += nums[i];
	}
	avg /= 10;

	std::cout << "avg : " << avg << std::endl;

	system("pause");

	return 0;
};
Leave a Comment