Quelpr

CAPE Computer Science Unit 2 · 2014 · Paper 2 · Question 2(b)(iii)

Write C code to read an integer 'key' from the user and search the array 'num' for it. If found, display the location of key; otherwise, display 'Key Not found'.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 2(a)Explain how the numbers 5 and 15 would be inserted into the singly linked list and draw the final linked list.[10 marks]
  2. 2(b)(i)Write C code to declare an array 'num' that can store 100 integers.[2 marks]
  3. 2(b)(ii)Write C code to fill the array 'num' with integers entered by the user.[4 marks]

More practice: the rest of this paper · more Searching and Sorting Algorithms questions · all CAPE Computer Science Unit 2 past papers