write a qbasic program to convert the temperature from celcius to farheneit.
Answers
Answer:
A program to convert temperature in celsius to fahrenheit (Qbasic)
PROGRAM TO CONVERT TEMPERATURE IN CELSIUS TO FAHRENHEIT (Qbasic)
CLS
INPUT “ENTER TEMPERATURE IN CELSIUS”; C
F = C * (9 / 5) + 32
PRINT “TEMPERATURE IN FAHRENHEIT=”; F
END
USING SUB PROCEDURE
DECLARE SUB CONVERT (C)
CLS
INPUT “ENTER TEMPERATURE IN CELSIUS”; C
CALL CONVERT (C)
END
SUB CONVERT (C)
F = C * (9 / 5) + 32
PRINT “TEMPERATURE IN FAHRENHEIT=”; F
END SUB
USING FUNCTION PROCEDURE
DECLARE FUNCTION CONVERT (C)
CLS
INPUT “ENTER TEMPERATURE IN CELSIUS”; C
PRINT “TEMPERATURE IN FAHRENHEIT=”; CONVERT (C)
END
FUNCTION CONVERT (C)
F = C * (9 / 5) + 32
CONVERT = F
END FUNCTION
Answer:
Explanation:
How to write a C program to convert Fahrenheit to Celsius with an example. The mathematical formula behind the temperature conversion from degree Fahrenheit to Celsius in C is: Celsius = (5 / 9) * (Fahrenheit – 32) C Program to Convert Fahrenheit to Celsius