Question:
Give the example for output....?
2011-01-05 21:39:54 UTC
Here is the question:
Write a program that converts integer Fahrenheit temperatures from 0 to 212 degrees to floating-point Celsius temperatures with 3 digits of precision.The output should be printed in two right-justified columns of 10 characters each, and the Celsius temperatures should be preceded by a sign for both positive and negative
values.

I didnt undrstnd the format so plz give the format of output.

Thanks.
Four answers:
SALEM M
2011-01-09 12:46:53 UTC
Solution delphi console try to convert it;

-------------------------------------------------------



Program FahrenToCelsius (Input, OutPut);



{$APPTYPE CONSOLE}



uses

SysUtils, StdConvs;

var I : Byte;

Degre : Double;

begin

Write ('Fahrenheit':15, 'Celsuis':20);



WriteLn;

WriteLn;



for I := 0 to 212 do begin

Degre := I;

Write (Degre:15:2, FahrenheitToCelsius(Degre):20:3);

WriteLn; end;



WriteLn;



WriteLn('Press any Key to exit');



ReadLn;



end.
?
2011-01-05 22:53:44 UTC
To convert C to F you multiply by 9.0/5 and add 32

To convert F to C you subtract 32 and multiply by 5.0/9



In C if you do not use a floating point number in the division, you get an integer answer so 5/9 would equal 0 and 9/5 would equal 1.



When you say 3 digits of precision, do you mean the answers should be in the format 100, 9.34, 0.00, 0.234, 0.000123 which all have three digits of precision or do you want three digits after the decimal point?



printf("C Temp = %.3f",c);

would give you three digits after the decimal point. I am not sure in C how to get three digits of precision.
Nolan Hodge
2011-01-05 21:58:08 UTC
if u divide Fahrenheit by 3 u get Celsius.





Create a program that accepts and integer then output the integer after dividing it by 3



so like int/3
2014-11-04 19:14:41 UTC
problematic situation. lookup from search engines like google. this can assist!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...