सामग्री पर जाएँ

कंप्यूटर प्रोग्रामिंग/कंडीशन/स्यूडोकोड

विकिविश्वविद्यालय से
Declare Choice

Display "Enter F to convert to Fahrenheit or C to convert to Celsius:"
Input Choice
If Choice == "C" OR Choice == "c" Then
    Call ToCelsius()
Else If Choice == "F" OR Choice == "f" Then
    Call ToFahrenheit()
Else
    Display "You must enter C to convert to Celsius or F to convert to Fahrenheit!"
End If
Declare F
Declare C

Display "Enter Fahrenheit temperature:"
Input F
Set C = (F - 32) * 5 / 9
Display F, "° Fahrenheit is ", C, "° Celsius"
Declare Real C
Declare Real F

Display "Enter Celsius temperature:"
Input C
Set F = C * 9 / 5 + 32
Display C, "° Celsius is ", F, "° Fahrenheit"