Table of Contents
Overview
Below is the QBASIC program to ask the temperature in Fahrenheit from the user and convert it into celcius.
REM Program to convert temperature in fahrenheit to celcius
CLS
INPUT "Enter the temperature in Fahrenheit: "; F
C = (F - 32) * (5/9)
PRINT "Temperature in celcius is: "; C
END
Output
Explanation
Let’s first see the formula: C = (F – 32) * 5/9. To calculate the temperature in Celcius, first, accept the temperature in Fahrenheit from the user and multiply the difference of F and 32 by (5/9).
More Programs
https://thinkshare.one/learn/programming/qbasic/