December
1998 QUESTION 1 (Compulsory) Total Marks: 20 Marks |
Click here to access other
questions
Click to access
|
(a) | Name two type modifiers other than unsigned.
|
[2] |
(b) | Name two storage class modifiers other than static.
|
[2] |
(c) | Describe what a structure and a union are, and
identify the difference between the two.
|
[3] |
(d) | Create appropriate declarations for each of the following variables: | |
(i) digits, an array of 10 unsigned integers. | [1] | |
(ii) apc, an array of 20 pointers to characters. | [1] | |
(iii) pacc, a pointer to an array of 20 characters.
|
[2] | |
(e) | Write a procedure maxpair that takes
two integer valued parameters x and y as its arguments. The effect of the procedure should
be to change the values of x and y so that x holds the larger of the two values, and y the
smaller.
|
[4] |
(f) | Trace the following code segment and produce the
output: void main(void) { one = &num_list[1]; one = one + 3; for(i=0; i<5; i++)
printf("%d ", num_list[i]);
|
[5] |