input year is leap year or not - programmingraja

 Aim: Write a lisp code for finding whether the input year is leap year or not.

Software Used: GNU common LISP

coding:

>(defun leap-year-p (year)

( and (divisible-by-p 4 year)

(or (divisible-by-p 400 year) 

(not (divisible-by-p 100 year)


LEAP-YEAR-P


>(leap-year-p 2020)

T

>(leap-year-p 2021)

NIL


OUTPUT :




Post a Comment

0 Comments