title: scanf not working. need to read double from console
body: <p>I'm  not sure what I'm doing wrong, but I'm not able to read a double from the console. Reading an it works fine for some reason. I'm using Xcode.</p>
  
  <pre><code>double n1;
  
  // get input from the user
  printf("Enter first number: ");
  scanf("%f", &amp;n1);
  
  printf("%f", n1);
  </code></pre>
  
  <p>This will always print 0 no matter what I enter.</p>