I\'m a C# developer trying to learn C (followed by C++). I am going native, working on Ubuntu using vim as my text editor, and the Gnu C Compiler (gcc) to compile.
I\'m
This line is problematic:
int celcius = (5/9)(i-32);
because the compiler thinks you're trying to invoke a function specified by (5/9)
. If you wished to do a multiplication, you should do:
int celcius = (5/9)*(i-32);
instead.
Moreover, if you expect floating-point values to be returned from that calculation, you should do:
int celcius = (5.0/9.0)*(i-32.0);
because 5/9
is an integer division and will never return a floating-point value.