#include void main(){ char input; int counter =0 ; int lowerValue=1, higherValue=100; int numberOfGuess = 0,myGuess=0 ; int count=0; myGuess = (lowerValue + higherValue)/2; printf("Is your number greater or equals to%d\n",myGuess); scanf("%c", input); while(count!=1){ myGuess = (lowerValue+higherValue)/2; if(input == '>'){ higherValue = myGuess; printf("Is your number greater or equals to%d\n",myGuess); numberOfGuess++; }else if(input == '<'){ lowerValue = myGuess; printf("Is your number greater or equals to%d\n",myGuess); numberOfGuess++; }else{ count=1; printf("You have guessed the number in%d\n",numberOfGuess); } } }