0
What is a result of the code?
#include <iostream> using namespace std; int main() { double sum = 0.0, num; const int NUMBER_OF_ENTRIES = 5; std::cout << "Please enter " << NUMBER_OF_ENTRIES << " numbers: 9, 3.5, 0.2, 100, 15.3 "; for (int i = 0; i < NUMBER_OF_ENTRIES; i++) { std::cin >> num; sum += num; } std::cout << "The average of " << NUMBER_OF_ENTRIES << " values is " << sum/NUMBER_OF_ENTRIES << '\n'; }
3 Answers
+ 1
Why don't you try it yourself đ
https://code.sololearn.com/c9YguWP4bx3V/?ref=app
0
What is wrong with my code, it doesn't compile properly. Shall you repait it, because I don't know how to declare numbers to average!
https://code.sololearn.com/cC1Kp96hiv5y/?ref=app