clear clc answer = input('is this a leap year? (0/1)') leapyear = (answer == 1); month = input('first q: what month? '); while (month > 0) && (month <= 12) switch month case {9, 4, 6, 11} days = 30; case {1, 3, 5, 7, 8, 10, 12} days = 31; case 2 if leapyear days = 29; else days = 28; end otherwise error('Pwthlthth!!!') end fprintf('Days in month %d are %d\n', ... month, days) month = input('what month? '); end