#include <iostream>
#include <iomanip>
int main()
{
//Curly braces prevent "Garbage" Integers," These cause no real anwer to ever be stated
int numOfData{};
int sum{};
int average{};
double num[100]{};
int i = 0;
sum = 0.000
//Prints Message
std::cout << "\n How many numbers would you like ? max 100 : ";
std::cin >> numOfData;
while (numOfData > 100 || numOfData <= 0)
{
std::cout << "\n Error! number should in range of (1 to 100).";
std::cout << "\n Enter the number again:";
std::cin >> numOfData;
}
//Loop executed until all numbers are filled
for (i = 0; i < numOfData; i++)
{
std::cout << ". Enter number " << i + 1 << ": ";
std::cin >> num[i];
sum += num[i];
}
average = sum / numOfData;
std::cout << "\n" << average;
std::cout << "\n The average is: " << average;
return 0;
}