Click here to Skip to main content
15,941,828 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more: (untagged)
Hi all, im trying to do my homework in programmning and i need to do a flowchart that converts fahrenheit to celcius.I have already done it but whenever i put the input the result is wrong.i dont get why.here is what i have written..


START

F

"converted temperature is: "; C=5//9*(f-32)

END

when it asks me for F the result is wrong.for ex: f is 3 ..result should be -16.1111111 but my code doesnt give me the minus symbol.
Would be glad if someone helped me as i am new to programming.
Posted
Comments
CPallini 19-Oct-15 9:11am    
"but my code doesnt give me the minus symbol"
What code? I don't see any code in your post.
By the way, in your code are you using floating point math, aren't you?
asus12 19-Oct-15 9:59am    
http://s1382.photobucket.com/user/asus111/media/Screenshot_1_zpsgoqcx8js.png.html?sort=3&o=0
this is what i have done and on the right side you can see that the result is posivite and not negative.
ZurdoDev 19-Oct-15 9:28am    
We can't see what you have; however, from what you posted the formula is correct. So, how can we help?
asus12 19-Oct-15 9:58am    
http://s1382.photobucket.com/user/asus111/media/Screenshot_1_zpsgoqcx8js.png.html?sort=3&o=0
this is what i have done and on the right side you can see that the result is posivite and not negative.
ZurdoDev 19-Oct-15 10:02am    
I have no idea what program that is. I've never used it before.

1 solution

That is because your formula is wrong. You should be using floating point numbers not integers. And you should also use a single forward slash for division. Whatever number you enter in the above formula the answer will be zero. However, in order to help you properly you need to edit your question and add the actual code you are using.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900