Write an M-File scripts that converts temperature in degrees
Fahrenheit (
°F) to
degrees Centigrade (
°C) by recall the conversion function in (a).
Use input and disp commands to display a mix of text and
number.
The input program would be: %Program to convert from F to C %Take the input from user ftemp = input('Enter your values in Degree Fahrenheit: '); %Convert the values from F to C using the conversion factor %C = (F – 32) * 5/9 ctemp = (ftemp-32)*5/9; %In the above statement you can also use (ftemp-32)*(5/9) or many other %combinations to avoid any problems with operator precedence. fprintf('%f F = %f C\n',ftemp,ctemp);
The result display of the program would be like:
Get Answers For Free
Most questions answered within 1 hours.