Give atleast two examples for each command of LISP

19
1.Give atleast two examples for each command of LISP. a. CL-USER 1 > Car b.CL-USER 1 > Cdr c.CL-USER 1 > setq 1 | Page

Transcript of Give atleast two examples for each command of LISP

1.Give atleast two examples for each command of LISP.

a. CL-USER 1 > Car

b.CL-USER 1 > Cdr

c.CL-USER 1 > setq

1 | P a g e

d.CL-USER 1 > Cons

e.CL-USER 1 > append

f.CL-USER 1 > last

2 | P a g e

g.CL-USER 1 > reverse

h.CL-USER 1 > atom

i.Cl-USER 1 > eq

3 | P a g e

j.CL-USER 1 > numberp

k.CL-USER 1 > zerop

4 | P a g e

l.CL-USER 1 > greater(>)

m.CL-USER 1 > lessp(<)

n.CL-USER 1 > plusp

5 | P a g e

o.CL-USER 1 > minusp

p.CL-USER 1 > oddp

q.CL-USER 1 > evenp

6 | P a g e

r.CL-USER 1 > integer

s.CL-USER 1 > floatp

t.CL-USER 1 > min

7 | P a g e

u.CL-USER 1 > max

v.CL-USER 1 > member

w.CL-USER 1 > and

8 | P a g e

x.CL-USER 1 > or

2.Write program in LISP for the following program :

a. To find the average of five numbers.

9 | P a g e

b. To convert the given temperature in Celcius into Fahrenheit.

10 | P a g e

c. To convert the given temperature in Fahrenheit into Celcius.

d. Convert the given hours into minutes and seconds.

11 | P a g e

e. To print your name ,class ,roll no and address.

f. To find the square root of a given no.

12 | P a g e

g. To check the enterd number is even or odd.

13 | P a g e

h. To calculate the area and parameter of rectangle,square and triangle.

i. To calculate area and circumference of circle.

14 | P a g e

j. To compute the nth Fibonacci number.

k. To find the factorial of any given number.15 | P a g e

l. To find the root of quadratic equation.

16 | P a g e

m. To find the sum of first n Natural numbers.

n. To find the largest and smallest among three given numbers.

17 | P a g e

o. To check entered year is leap year or not.

p. To exchange the value of two variables.

18 | P a g e

19 | P a g e