In C++ please:   Read integers from input and store each integer into a vector until 0 is read. Do not store 0 into the vector. Then, output all values in the vector (including the last value) each multiplied by the last value in the vector. Output each value on a new line. Ex: If the input is -63 79 -48 7 0, the output is: -441 553 -336 49 #include #include using namespace std; int main() { //place code here return 0; }

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 17SA
icon
Related questions
Question

In C++ please:

 

Read integers from input and store each integer into a vector until 0 is read. Do not store 0 into the vector. Then, output all values in the vector (including the last value) each multiplied by the last value in the vector. Output each value on a new line.

Ex: If the input is -63 79 -48 7 0, the output is:

-441 553 -336 49

#include <iostream>
#include <vector>
using namespace std;

int main() {

//place code here

return 0;
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning