Complete the MATLAB code by filling the blanks
Exercise 6: Complete the following code (switch-case statement) Write a script to convert the temperature from Fahrenheit to Celsius and vice versa clear cls; temp = input("input a temperature: "); unit = input("Do you want to convert to F or C: ", 's'); switch case {'f', 'F} (9/5) * temp + 32; fprintf("the temperature in F is %f \n", res) BEBER res = case res = 5/9 * (temp-32 fprintf HERE disp("wrong input") end
Exercise 6: Complete the following code (switch-case statement) Write a script to convert the temperature from Fahrenhei
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Exercise 6: Complete the following code (switch-case statement) Write a script to convert the temperature from Fahrenhei
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!