title: How to not invoke warning: type specifier missing?
body: <p>I am reading "<a href="https://github.com/mixelpixel/The-C-Programming-Language#the-c-programming-language" rel="noreferrer">The C programming Language</a>" by Brian W. Kernighan and Dennis M. Ritchie. In chapter 1.2 "Variables and Arithmetic Expressions" they demonstrate a simple Fahrenheit to Celsius converter program. When I compile the program (Terminal.app, macOS Sierra), I get this warning:</p>
  
  <pre><code>$  cc FtoC.c -o FtoC.o
  FtoC.c:5:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
  main()
  ^
  1 warning generated.
  </code></pre>
  
  <p>This is the C program:  </p>
  
  <pre><code>FtoC.c:
    1 #include &lt;stdio.h&gt;
    2 
    3 /* print Fahrenheit-Celsius table
    4     for fahr = 0, 20, ..., 300 */
    5 main()
    6 {
    7   int fahr, celsius;
    8   int lower, upper, step;
    9 
   10   lower = 0;      /* lower limit of temperature scale */
   11   upper = 300;    /* upper limit */
   12   step = 20;      /* step sze */
   13 
   14   fahr = lower;
   15   while (fahr &lt;= upper) {
   16       celsius = 5 * (fahr-32) / 9;
   17       printf("%d\t%d\n", fahr, celsius);
   18       fahr = fahr + step;
   19   }
   20 }
  </code></pre>
  
  <p>If I understand <a href="https://stackoverflow.com/a/34774190/5225057">this SO answer</a> correctly, this error is the result of non-compliance with the C99 standard. (?)  </p>
  
  <blockquote>
    <p>The problem is not the compiler but the fact that your code does not follow the syntax. C99 requires that all variables and functions be declared ahead of time. Function and class definitions should be placed in a .h header file and then included in the .c source file in which they are referenced.  </p>
  </blockquote>
  
  <p>How would I write this program with the proper syntax and header information to not invoke this warning message?  </p>
  
  <p>For what it is worth, the executable file outputs the expected results:  </p>
  
  <pre><code>$  ./FtoC.o 
  0   -17
  20  -6
  40  4
  60  15
  80  26
  100 37
  120 48
  140 60
  160 71
  180 82
  200 93
  220 104
  240 115
  260 126
  280 137
  300 148
  </code></pre>
  
  <hr>
  
  <p><a href="https://www.tutorialspoint.com/cprogramming/c_functions.htm" rel="noreferrer">This</a> was useful:</p>
  
  <pre><code>return_type function_name( parameter list ) {
     body of the function
  }
  </code></pre>
  
  <p>Also <a href="http://www.electronicdesign.com/dev-tools/what-s-difference-between-c-now-and-then" rel="noreferrer">this overview</a> of K&amp;R C vs C standards, and a <a href="https://stackoverflow.com/a/562377/5225057">list of C programming books</a>, or, for the <a href="https://stackoverflow.com/a/83763/5225057">C language standards</a>.  </p>