Interactive Problems in Competitive Programming |  ; Iterating from lower_bound to upper_bound ; Input the response from the judge
import java . util . * ; class GFG { public static void main ( String [ ] args ) { Scanner sc1 = new Scanner ( System . in ) ; int lower_bound = 2 ; int upper_bound = 10 ; for ( int i = lower_bound ; i <= upper_bound ; i ++ ) { System . out . println ( i ) ; int response = sc1 . nextInt ( ) ; if ( response == 0 ) { System . out . println ( " Number ▁ guessed ▁ is ▁ : " + i ) ; break ; } } } }