title: User input string variable in C
body: <p>So I am learning the C programming language and I want to run a basic script in which the user inputs a variable and the variable that is printed out is the one in which the user inputed, which is simple, however, the code I wrote prints a random thing that has nothing to do with the code, please help.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  char main(void){
          char var[3];
          printf("Enter your name: ");
          scanf("%1f", &amp;var);
          printf("%s", &amp;var);
  
          }
  </code></pre>