Wednesday, October 16, 2019

33. Qbasic Program to input Fahrenheit and convert it into Celsius


33.      Write a program to input Fahrenheit and convert it into Celsius using SUB - END SUB. 
DECLARE SUB CONVERT (F)
CLS
INPUT “ENTER TEMPERATURE IN FARENHEIT”; F
CALL CONVERT (F)
END

SUB CONVERT (F)
C = (F – 32) * (5 / 9)
PRINT “TEMPERATURE IN CELCIUS=”; C
END SUB

1 comment: