Write a loop that reads positive integers from standard input, printing out those values that are greater than 100, and that terminates when it reads an integer that is not positive. The values should be separated by single blank spaces. Declare any variables that are needed.

LANGUAGE: C++

CHALLENGE:

Write a loop that reads positive integers from standard input, printing out those values that are greater than 100, and that terminates when it reads an integer that is not positive. The values should be separated by single blank spaces. Declare any variables that are needed.

SOLUTION:


int num;
do{
    cin >> num;
    if (num > 100)
        cout << num << " ";
}
while (num>0);