April 2000 QUESTION 1 (Compulsory) Total Marks: 30 Marks |
Click here to access other
questions
Click to access |
(a)(i)Describe the purpose of a storage
class modifier in C,quoting an (b)(i)Give a declaration for an array
of 5 integers,with all the elements initialised to 0.[2 marks ] (c)Assuming x y and z are all declared
as int state the value of z in the following (d)Give the result of applying the arithmetic
operators in the following expressions, (e)Give the output of the procedure FooBar
the definition of which is given below: (f)Write a procedure,called CharCount
the signature of which is given below,which takes in three parameters,a
string s, a character c and an index i The procedure should calculate
how many times c appears in s and return this value as the index i (g)Given the following definition of a simple linked list in C,define a recursive function, called search which takes three parameters,a linked list l, a value v and an index i. The function should return a reference to the the first element in the list which matches the value passed in,and the index i should indicate how many list elements have been traversed. typedef struct node { |