Hi,

I've just started teaching myself C. I'm very familiar with networking and hardware, and I decided to branch out to programming. That said, I bought the book C Programming, A Visual Quickstart Guide by Larry Ullman and Marc Liyanage. I'm only on chapter 2, so my problem/code is all very simple, but I've already come up on an issue that I'd appreciate some help with, even though it is probably far below the normal scope of this board.

Each chapter contains little programs that the reader basically copies word-for-word for the sake of practicing/explaining different concepts. The piece I'm working on is introducing constants, and is on page 32 and 33, if anyone happens to have the book/cares to look it up on Amazon.

here's the code:

Code:
/* temperature.c - script 2.6
 * a script  to demonstrate constants */

#include <stdio.h>

        int main (void) {
                int fahrenheit = 212;
                const int SUBTRACT_NUM = 32;
                const int RATIO = 5.0/9.0;

                printf ("%d degrees Fahrenheit is %0.1f degrees Celcius.\n", fahrenheit, (fahrenheit - SUBTRACT_NUM) * RATIO);

                getchar();
                return 0;
}
As I said, it's very simple, but I'm trying to go through and be thorough, so I don't miss anything. The issue that I'm having is that when I compile I get no errors, but when I actually execute the program, the output comes out as the following:

Code:
 212 degrees Fahrenheit is 0.0 degrees Celcius.
The example in the book (and actually doing the math) says that it should print this:

Code:
212 degrees Fahrenheit is 100 degrees Celcius.
I have gone over the entire program, and am not seeing what I did wrong. Perhaps someone could provide me a fresh pair of eyes and see what I've done wrong?

Also I'm compiling it using gcc on a Debian Lenny box. The output of gcc -v:

Code:
 
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1.1)
I'm not sure if that's relevant, but I've always been one to include more info, than none at all. Thanks in advance for any help anyone can give me!