First, read in an input value for variable numInput. Then, read numInput integers from input and output each integer on a newline after the string "input = ". Ex: If the input is 2 30 40, the output is: input = 30 input = 40
The Answer to the Question
is below this banner.
Can't find a solution anywhere?
NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?
Get the Answers Now!You will get a detailed answer to your question or assignment in the shortest time possible.
Here's the Solution to this Question
#include <iostream>
using namespace std;
int main() {
int numInput;
cin >> numInput;
int* input = new int[numInput];
for (int i=0; i<numInput; i++) {
cin >> input[i];
}
for (int i=0; i<numInput; i++) {
cout << "input = " << input[i] << endl;
}
delete [] input;
return 0;
}