Take 10 integers from keyboard using loop and print their average value on the screen in c++
#include <iostream>
using namespace std;
int main() {
// #ifndef ONLINE_JUDGE // not part of code, used to beautify input output
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
int i, num, sum = 0;
float avg;
for (i = 0; i < 10; i++) {
cin >> num;
sum = sum + num;
}
avg = sum / 10.0;
cout << avg;
return 0;
}