
function fcf()
% T,C=(T,F-32)*5/9
% T,F=T,C*9/5+32
inpt=input("Enter temperature (t and C or F) = ","s");
A=sscanf(inpt,'%f %s');
if length(A) == 1
    disp("Error: check number of parameters")
    return
end

t=A(1);type=char(A(2));

if type == "c"|type == "C"
    newtemp=t*9/5+32;
    disp([num2str(newtemp),' F'])
    return
end

if type == "f"|type == "F"
    newtemp=(t-32)*5/9;
    disp([num2str(newtemp),' C'])
    return
end
end
