//How to convert temperature from fahrenheit to celsius or vice versa
Code:#include <stdio.h> int main() { double cel; for(int i=32; i<=212; i++) } cel = (.555)*(i-32); printf( The degree "i" farenheit would be "cel" in celsius); }
//How to convert temperature from fahrenheit to celsius or vice versa
Code:#include <stdio.h> int main() { double cel; for(int i=32; i<=212; i++) } cel = (.555)*(i-32); printf( The degree "i" farenheit would be "cel" in celsius); }
Anna
1) You have an incorrect number of { and }. For every { there is one and only one }. Without it, you have a problem.
2) Use correct indenting and your code is much easier to read. Common practice is to indent one step for each { and to un-indent one step for each }.
3) As per the previous thread you have, you know how to use printf, so how about you use it correctly and put in some format speficiers. %d and %f come to mind...
Quzah.
Hope is the first step on the road to disappointment.
I'm sure this is a homework assignment. And I'm sure that you are supposed to fix the errors. I don't want to condone cheating but this algorithm is everywhere on the internet. Just go to google.