Week 2 Quiz

Which of the following results should be returned as a result of the following function definition and corresponding function call? (defun fun (x) (cond ((not x) 0) (t (+ (fun (cdr (cdr x))) (car x))) ) ) (fun (quote (1 2 3 4)))
10
6
4
7
None
Which of the following results should be returned as a result of the following function definition and corresponding function call? (defun fun (x y) (cond ((not y) y) ((eq x (car y)) x) (t (fun x (cdr y))) ) ) (fun 3 (quote (1 2 3 4)))
Nil
3
(1 2 3 4)
(3 4)
None
{"name":"Week 2 Quiz", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Which of the following results should be returned as a result of the following function definition and corresponding function call? (defun fun (x) (cond ((not x) 0) (t (+ (fun (cdr (cdr x))) (car x))) ) ) (fun (quote (1 2 3 4))), Which of the following results should be returned as a result of the following function definition and corresponding function call? (defun fun (x y) (cond ((not y) y) ((eq x (car y)) x) (t (fun x (cdr y))) ) ) (fun 3 (quote (1 2 3 4)))","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker