Quelpr

CAPE Computer Science Unit 1 · 2012 · Paper 2 · Question 5(c)(ii)

Write C code to read the integers from the file "num.dat" created in (c)(i), add 5 to each integer and print the result on the screen.

The mark scheme is shown once you've answered.

Practise this question

Other parts of this question

  1. 5(a)Briefly describe THREE stages of the program translation process.[6 marks]
  2. 5(b)Write a C function which accepts a positive integer, n, and returns 2^n. State any assumptions made.[7 marks]
  3. 5(c)(i)Write C code to store the even numbers from 2 (inclusive) to 40 (inclusive) in a file called "num.dat".[7 marks]

More practice: the rest of this paper · more Modular Programming and Data Structures questions · all CAPE Computer Science Unit 1 past papers