I am at the beginning with my studies and would like to ask a question regarding a function in pascal. The aim is to calculate the Fahrenheit value in Celsius. The formula is as follows: C = [5 * (F - 32)] / 9.
The user should put in his value and it should result in the correct number. My program is so far:
Program Temperaturerrechnung (input, output);
var
C: real;
F: real;
begin
writeln('Insert Fahrenheit', F);
readln(F);
C:= (5 * (F - 32)) / 9
writeln('The temperature is C: ', C)
end
When compiling, it tells me that F has not identified.
readLninto arealvariable. You'd have to have a separatetextvariable and then cast it toreal(don't remember the syntax for that, though... it might beStrToFloatdepending on which version of Pascal you are using) - Pekka