aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 128
  • (define myList (list 1 2 3 4 5 6 7 8 9)) (- (+ (list-ref ...
Multiple choice technology programming languages

(define myList (list 1 2 3 4 5 6 7 8 9)) (- (+ (list-ref mylist 2) (cadr mylist)) (list-ref (cddr mylist) 2)) Output of the above code will be:

  1. 1

  2. -1

  3. 5

  4. 0

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

myList = (1 2 3 4 5 6 7 8 9). Zero-indexed: list-ref myList 2 = 3. cadr myList = 2. Sum = 5. cddr myList = (3 4 5 6 7 8 9). list-ref (cddr myList) 2 = 5. Final: 5 - 5 = 0.

Keep practicing — related questions

  • (define list1 (list 1 2 3)) (define list2 (list 4 5 6)) (define list3 (list)) (append list3 list1 list2) wh...
  • Match the List I with List II and select the correct answer using the codes given below ||| |---|---| |List...
  • Match List-I with List-II and select the correct answer from the code given below the lists� ||||| |---|---...
  • Match the following List - I with List - II and point out the correct code ||| |---|---| | List - I| List -...
  • Match List-I with List-II and select the correct answer using the codes given below: | || |---|---| |List I...
  • what is the output of the following program
  • Match List-I with List-II and select the correct answer using the codes given below the lists: | || |---|--...
  • Match List-I with List-II and select the correct answer using the codes given below the lists: ![](https://...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy