title: How to translate cout/cins to printf/scanfs?
body: <p>I coded an easy game. I know how to use cout/cin but having problems with printf/scanf. The code below works well with cout/cin. Question is, how to convert them into printf/scanf? Why the codes in comment don't work?</p>
  
  <p>Edit: I mean if I delete cout/cin lines and when I use printf/scanf instead it doesn't work properly.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;time.h&gt;
  
  using namespace std;
  
  int main()
  {
      srand(time(NULL));
      int min=0, max=1000, guess, counter=0;
      bool winner=false;
      char answer;
  
      while(counter&lt;10){
          guess = rand()%(max-min)+min;
          // printf("Did you pick %d? \t", guess);
          // scanf("%c", &amp;answer);
          cout &lt;&lt; "Did you pick " &lt;&lt; guess &lt;&lt; "?\t";
          cin &gt;&gt; answer;
          if(answer=='y'){ // yes
              winner=true;
              // printf("Computer wins.\n");
              // printf("You picked: %d", guess);
              cout &lt;&lt; "Computer wins." &lt;&lt; endl;
              cout &lt;&lt; "You picked: " &lt;&lt; guess;
              break;
          }
          else if(answer=='m'){ // more
              min=guess;
              counter++;
          }
          else if(answer=='l'){ // less
              max=guess;
              counter++;
          }
      }
      if(winner==false){
          // printf("User wins.\n");
          cout &lt;&lt; "User wins." &lt;&lt; endl;
      }
      return 0;
  }
  </code></pre>