Switch Case

%% switch case

clear;
clc;
units = input('Enter the units of measurement :','s');
switch units
    case 'length'
        disp('meters')
    case 'volume'
        disp('liters')
    case 'time'
        disp('seconds')
    otherwise
        disp('I give up')
end

results matching ""

    No results matching ""