What is a result of the code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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'; }

16th Feb 2020, 8:51 AM
TeaserCode
2 Answers
+ 1
Why don't you try it yourself 👇 https://code.sololearn.com/c9YguWP4bx3V/?ref=app
16th Feb 2020, 9:06 AM
Arsenic
Arsenic - avatar
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
17th Feb 2020, 8:42 AM
TeaserCode