Programming Fundamentals/Variables/Pseudocode

From Wikiversity
Jump to navigation Jump to search

variables.txt[edit | edit source]

... This program converts an input Fahrenheit temperature to Celsius.

Function Main
    Declare Real fahrenheit
    Declare Real celsius
    
    Output "Enter Fahrenheit temperature:"
    Input fahrenheit
    Assign celsius = (fahrenheit - 32) * 5 / 9
    Output fahrenheit & "° Fahrenheit is " & celsius & "° Celsius"
End

See Also[edit | edit source]