December
1998 QUESTION 4 Total Marks: 20 Marks |
Click here to access other
questions
Click to access
|
(a) | What is the effect of adding the keyword static
to a local variable in a procedure?
|
[2] |
(b) | Describe the difference between
call-by-reference and call-by-value parameter passing in C.
|
[4] |
(c) | Find the eight syntax errors in the
following fragment of code: include <stdio.h> void func(int x[], int y) main() { for (i=0;i<5,i++) a[i] = 2*1; b==16; void func(int x[], int y);
|
[8] |
(d) | Write a function that prompts the
user to enter a number in the range 0-4. If the number entered is outside the required
range, a prompt for user input should be repeated; otherwise the function returns the
integer selected by the user.
|
[6] |