Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

a)

Code Block
function celsius = fahrenheit2celsius(fahrenheit)
    celsius = (fahrenheit- 32)*5/9;
end

b)

Code Block
function fahrenheit = getTemp()
 fahrenheit = input('Hva er temperaturen i fahrenheit? ');
end

c)

Code Block
function  tempConverter()
fahrenheit = getTemp();
celsius = fahrenheit2celsius(fahrenheit);
fprintf('%.2f\n',celsius)
end