Home /
Expert Answers /
Computer Science /
write-an-expression-that-executes-the-while-loop-until-a-positive-integer-is-read-from-input-a-while-pa253
(Solved): Write an expression that executes the while loop until a Positive integer is read from input A while ...
Write an expression that executes the while loop until a Positive integer is read from input
A while loop reads integers from input. Write an expression that executes the while loop until a positive integer is read from input. Ex: If the input is \( -17-26 \quad 42 \), then the output is: Integer is \( -17 \) Integer is \( -26 \) Loop terminated 1 #include 2 using namespace std; 4 int main() \{ 5 int in; 6 in \( \rightarrow \) in; \( \frac{7}{9} \). while \( ( \) inet-16) 18 cout « "Integer is " « in «end; 11 cin \( \gg \) in; 12 3 13 cout \( \propto \) "Loop terminated" \( \ll \) endl; 15 2 3 The whise loop iterates and outputs "integer is", followed by the integer read from input, until a positive integer is read from input. Then, the loop terminates and "Loop terminated" is output Not ath tests passed