Create a user function to convert degrees F to degrees C Nam

Create a user function to convert degrees F to degrees C Name the function: F to C 1 input argument: degrees_F 1 output argument: degrees_C Use formula: C= 5 *(F-32)9; Save as: F to C.m Try using the function in the command window. Then create a script & ask the user for temperature in degrees. Use your function F to C. Have your script display the resulting a sentence using the fprintf command (show 2 places after decimal point).

Solution

function FtoC(degrees_F)
degrees_C = 5.0*(degrees_F-32)/9.0;
fprintf(\'The temperature in celsius is %.2f\ \',degrees_C);
end
FtoC(100);

 Create a user function to convert degrees F to degrees C Name the function: F to C 1 input argument: degrees_F 1 output argument: degrees_C Use formula: C= 5 *

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site