title: Bug in Scanf function
body: <p>My program is so simple yet it has a bug that I cannot solve.
  Here is the code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(int argc, const char * argv[]) {
  
  char name[100];
  int age;
  
  printf("What's your name?\n");
  scanf("%s", name);
  
  printf("Hey %s!\n",name);
  
  printf("How old are you?\n");
  scanf("%d\n", &amp;age);
  
  printf("You're %d years old, cool!\n", age);
  
  
  return (0);
  }
  </code></pre>
  
  <p>I have a bug when I get to the <code>scanf</code> for age. Even once I have typed a number e.g 22, I am supposed to press enter. However this just makes a new line. It seems that the program is not able to detect my integer value.</p>