- #1
Chrisanchez
- 3
- 0
First, read in an input value for variable inputCount. Then, read inputCount integers from input and output each integer on a newline after the string "value - ".
Ex: If the input is 2 25 55, the output is:
value - 25
value - 55
I'm having trouble figuring out what I'm doing wrong, I able to get the output that I wanted but it keeps repeating the last output that is needed. for example the output that I'm getting is "value - 25 value - 55 value -55 . . ." and it keeps repeating the last output.
Ex: If the input is 2 25 55, the output is:
value - 25
value - 55
Code: #include <iostream> using namespace std; int main() { int inputCount; int i; cin >> inputCount; for(i=0; inputCount > i | | inputCount < i; ++i){ cin >> inputCount; cout << "value - " << inputCount << endl; } return 0; } |