Question: write a complete C++ program. Initialize a vector numbers variable. Use a while to read one double at a time from the user until there

write a complete C++ program. Initialize a vector numbers variable. Use a while to read one double at a time from the user until there is no more user input. Each double should be stored in the vector numbers. After the while loop, use a for-each loop to print each number on its own line.

This is my code, I'm not sure why the result is not priting.

#include #include

using std::cin; using std::cout; using std::endl; using std::vector;

int main() { vector numbers; cout <<"Please enter a number: " << endl; double input; while (cin >> input) { for (double x{0}; x

return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!