QBASICPROGRAM TO CHECK/FIND LEAP YEAR
LEAP YEARS : 1988,1992,.....2020,2024,etc.
CLS
INPUT “ENTER YEAR”; Y
IF Y MOD 4 = 0 AND Y MOD 100 < > 0 OR Y MOD 400 = 0 THEN
PRINT Y; IS LEAP YEAR”
ELSE
PRINT Y; IS NOT LEAP YEAR”
END IF
END
USING SUB
DECLARE SUB LEAP(Y)
CLS
INPUT “ENTER YEAR”; Y
IF Y MOD 4 = 0 AND Y MOD 100 < > 0 OR Y MOD 400 = 0 THEN
PRINT Y; IS LEAP YEAR”
ELSE
PRINT Y; IS NOT LEAP YEAR”
END IF
END SUB
0 Comments