Commit a82c1c87 authored by mary.zaqaryan's avatar mary.zaqaryan

Mary Zaqaryan Exercise_05_06 Version3

parent 5215790e
......@@ -8,7 +8,7 @@ main()
while (true) {
int number;
std::cout << "Enter the number or 9999 to quit.";
std::cout << "Enter the number (9999 to quit): ";
std::cin >> number;
if (9999 == number) {
......@@ -19,7 +19,8 @@ main()
++counter;
}
double average = sum / counter;
double sequence = static_cast<double>(sum);
double average = sequence / counter;
std::cout << "Average is: " << average << std::endl;
return 0;
}
Enter the number or 9999 to quit.Enter the number or 9999 to quit.Enter the number or 9999 to quit.Enter the number or 9999 to quit.Enter the number or 9999 to quit.Enter the number or 9999 to quit.Average is: 9
Enter the number (9999 to quit): Enter the number (9999 to quit): Enter the number (9999 to quit): Enter the number (9999 to quit): Enter the number (9999 to quit): Enter the number (9999 to quit): Average is: 9.2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment