Hello all,
I'm a very new student of C++. I've been enjoying and taking advantage of this website's tutorials and other resources for a little while. I decided recently to start working through some of cprogramming's practice problems. The first one is in a "fill in the blank" format and deals with array input and output.
Here's the introduction
Array Challenge
When completed, the following program should first fill in (by asking the user for input) and then list all the elements in an array:
The "fill in the blank" portion looks like this.
This is the provided solutionCode:#include <_____> using namespace std; ___ main() { int array[8]___ for(int x=_; x<_; ___) cin>>______; for(____; x<____; ___) cout<<_____; return __; ____
Now, as I previously stated, I am very very much a newbie. But from what I do understand, won't the first conditional iterate until it has fulfilled the condition for itself, then just "drop through" the second, as it has already fulfilled its condition as well?? That's what it seems to be doing when I compile it. Please let me know if I'm missing anything.Code:#include <iostream> using namespace std; int main() { int array[8]; for(int x=0; x<8; x++) cin>>array[x]; for(int x=0; x<8; x++) cout<<array[x]; return 0; }
Thanks



LinkBack URL
About LinkBacks



