- To
sum all the even elements of the list
- Sum
all the elements upto n
- Sum
of squares of all the elements in the list
- Count
the number of elements in a list
- Sum
all the elements upto n using iteration
- To
return the Nth element of the list
- Write
a LISP program addlist that takes as its arguments an element and a list.If
the element is already in the list,the function returns the input
list;otherwise it returns the list that includes the given element in the
original list.
Example : (addlist 'c '(a,b,c,d)) = (a,b,c,d)
(addlist 'e '(a,b,c)) = (e,a,b,c)
- Write
a LISP program which reads five numbers,calculates their sum and the Nth
power of individual numbers.The results must be stored in 2 separate
lists.
- Factorial
- Recursion
- Factorial
- Iterative
- Write
a LISP function max3 which finds maximum of 3 numbers.
- Define
the functions called left-rotate and right-rotate,these 2 functions takes
a list and rotates the elements by one position as in
right-rotate '(a b c d) returns (d a b c)
left-rotate '(a b c d) returns(b c d a)
Ó CodeEverywhere