title: Can scanf() be used to declare a variable in C?
body: <p>So, I just have a simple code. I was asked to verify how many times it would run.</p>
  
  <pre><code>int i = 0;
  int s = 0;
  int b = 0;
  while(i &lt; 10){
      printf("Enter an integer: ");
      scanf("%d" ,&amp;x);
      s += x;
      if(x &gt; b){
          b = x;
      }
      i++;
  </code></pre>
  
  <p>I stated it would never run due to <strong>x</strong> not being declared. I was told I was wrong and it was declared. </p>
  
  <p>My question is can scanf() declare a variable? Or would you say the only way this code would run is if <strong>x</strong> is declared? </p>