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

conditions.txt सम्पादन

मुख्य सम्पादन

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

ToCelsius सम्पादन

Declare F
Declare C

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

ToFahrenheit सम्पादन

Declare Real C
Declare Real F

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

यह भी देखें सम्पादन