Interactive Problems in Competitive Programming |  ; Iterating from lower_bound to upper_bound ; Input the response from the judge
#include <bits/stdc++.h> NEW_LINE using namespace std ; int main ( ) { int lower_bound = 2 ; int upper_bound = 10 ; for ( int i = lower_bound ; i <= upper_bound ; i ++ ) { cout << i << endl ; int response ; cin >> response ; if ( response == 0 ) { cout << " Number ▁ guessed ▁ is ▁ : " << i ; break ; } } return 0 ; }