Home /
Expert Answers /
Computer Science /
c-write-a-while-loop-to-read-integers-from-input-until-zero-is-read-for-each-integer-read-befo-pa515
(Solved): C++
Write a while loop to read integers from input until zero is read. For each integer read befo ...
C++
Write a while loop to read integers from input until zero is read. For each integer read before zero, add the integer to vector vect1. Ex: If the input is \( \begin{array}{lllll}8 & 7 & 9 & 0 \text {, then the output is: }\end{array} \) 3 \( \perp \) HLicluae 3 using namespace std; 4 5 int main() \{ 6 vector \( < \) int \( > \) vect 1 ; 7 int value; 8 int \( i \); 11 for \( (i=0 ; i<\operatorname{vect} 1 . \operatorname{size}() ;++i)\{ \) \( 13 \quad \) for \( \quad \) cout \( < \) vect 1. at \( (i) \ll \) endl; \( 14 \quad 3 \) 15 16 return 0 ;