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

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

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"

यह भी देखें[सम्पादन | स्रोत सम्पादित करें]