title: Can't compile an example program from The C Programming Language
body: <p>I know programming in Java, but I'm reading "The C Programming Language", second edition. It says that to compile and run a program from the command line you have to do:</p>
  
  <pre><code>$ cc hello.c  //assuming the name of the file is hello.c
  ./a.out
  </code></pre>
  
  <p>and <code>hello world</code> is printed. I tried that and worked fine.</p>
  
  <hr>
  
  <p>Now, there is another example that prints a bunch of Celsius and Fahrenheit temperatures, so I created a file called <code>TemperatureConverter.c</code> with the given code. However, in the command line, when I ran:</p>
  
  <pre><code>$ cc TemperatureConverter.c
  </code></pre>
  
  <p>I got an error:</p>
  
  <blockquote>
    <p>/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/crt1.o: In function `_start':
    (.text+0x20): undefined reference to `main'<br>
    collect2: error: ld returned 1 exit status</p>
  </blockquote>
  
  <p>I don't know what this means. I tried double checking my syntax and it looks correct. I included the screenshot of the given code compared to the code I wrote, in case anybody notices a difference that may be causing the error:</p>
  
  <p><a href="https://i.stack.imgur.com/V6hY3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V6hY3.png" alt="Screenshot of the given code"></a></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  main()
  {
    float fahr, celcius;
    int lower, upper, step;
  
    lower = 0;
    upper = 300;
    step = 20;
  
    fahr = lower;
    while (fahr &lt;= upper) {
      celcius = (5.0/9.0) * (fahr - 32.0);
      printf("%3.0f %6.1f\n", fahr, celcius);
      fahr = fahr + step;
    }
  }
  </code></pre>