It looks like you have integer division in the second case:
tempC=((5/9)*(tempF-32))
The 5 / 9
will get truncated to zero.
To fix that, you need to make one of them a floating-point type:
tempC=((5./9.)*(tempF-32))
Related Contents:
- Implicit type promotion rules
- What is the “–>” operator in C/C++?
- How to avoid pressing Enter with getchar() for reading a single character only?
- Why does the order of the loops affect performance when iterating over a 2D array?
- Why doesn’t a+++++b work?
- C loop optimization help for final assignment (with compiler optimization disabled)
- What registers to save in the ARM C calling convention?
- Dynamic allocation of an unknown matrix in C
- I can use more memory than how much I’ve allocated with malloc(), why?
- int main() vs void main() in C [duplicate]
- What is the fastest substring search algorithm?
- The “backspace” escape character ‘\b’: unexpected behavior?
- Is NULL always zero in C?
- How do I understand complicated function declarations?
- Why sizeof(param_array) is the size of pointer?
- clock_gettime alternative in Mac OS X
- Short circuit evaluation and side effects [duplicate]
- Checking return value of a function without return statement
- Why does passing char** as const char** generate a warning?
- What is the full “for” loop syntax in C?
- Getting each individual digit from a whole integer
- gcc will not properly include math.h
- Try catch statements in C
- What is Undefined Behaviour in C? [duplicate]
- What are .a and .so files?
- How can I create a dynamically sized array of structs?
- Are nested functions a bad thing in gcc ? [closed]
- FFmpeg C API documentation/tutorial [closed]
- printf string, variable length item
- Why doesn’t GCC optimize structs?
- How to optimize these loops (with compiler optimization disabled)?
- Unexpected C/C++ bitwise shift operators outcome
- Are C-structs with the same members types guaranteed to have the same layout in memory?
- Resizing an array with C
- segfault only when NOT using debugger
- Difference between _Bool and bool types in C?
- how to get hexdump of a structure data
- Why use enum when #define is just as efficient? [duplicate]
- Receiving multiple multicast feeds on the same port – C, Linux
- How to return matrix (2D array) from function? (C)
- Why gets() is deprecated? [duplicate]
- How is the result struct of localtime allocated in C?
- Argument-parsing helpers for C/Unix
- Implementation of sizeof operator
- How can a shared library (.so) call a function that is implemented in its loader code?
- bind socket to network interface
- “UNDEFINED REFRENCE TO clrscr();” [duplicate]
- How to enable linking floating point library in TurboC?
- How do I print a #defined constant in GDB?
- C syntax for functions returning function pointers