title: Using 'printf' on a variable in C
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int x = 1;
  
      printf(&quot;please make a selection with your keyboard\n&quot;);
      sleep(1);
      printf(&quot;1.\n&quot;);
  
      char input;
      scanf(&quot;%c&quot;, &amp;input);
      switch (input) {
          case '1':
              x = x + 1;
              printf(x);
      }
      return(0);
  }
  </code></pre>
  <p>I am trying a make a variable add to itself and then print that variable out, but I can't seem to get my code to work.</p>
  <p>My output error is</p>
  <pre class="lang-none prettyprint-override"><code>newcode1.c: In function ‘main’:
  newcode1.c:20:2: warning: passing argument 1 of ‘printf’ makes pointer from integer without a cast [enabled by default]
  In file included from newcode1.c:1:0:
  /usr/include/stdio.h:362:12: note: expected ‘const char * __restrict__’ but argument is of type ‘int’
  newcode1.c:20:2: warning: format not a string literal and no format arguments [-Wformat-security]
  </code></pre>