CONFIDENTIAL CS/MAC 2024CSC404
UNIVERSITI TEKNOLOGI MARA
TEST 1
COURSE : PROGRAMMING II
COURSE CODE : CSC404
DATE : MARCH 2024
TIME : 1.45 HOURS
INSTRUCTIONS TO CANDIDATES
1. Answer ALL questions.
2. This question paper consists of two(3) parts: PART A (5 Questions)
PART B (3 Questions)
PART C (2 Questions)
3. Do not bring any material into the examination room unless permission is given by
the invigilator.
NAME :
MATRIC NO :
GROUP :
LECTURER :
DO NOT TURN THIS PAGE UNTIL
This examination paper consists of 6 printed
pages
, PART A (10 marks)
1. The declaration
int (*p) [10];
means
A. p is a pointer to a 10 elements integer array.
B. p is a one dimensional array of size 10, of pointers to integers.
C. The same as int *p[
D. None of these.
2. Which of the following is a complete function?
A. int funct();
B. int funct(int x) { return x=x+1; }
C. void funct(int) { cout<<“Hello"; }
D. void funct(x) { cout<<“Hello"; }
3. Choose a correct statement with array pointers.
A. It is valid to add an integer number to an array pointer. Result can be anything
B. It is valid to subtract an integer number from an array pointer. Results can be
anything.
C. Difference of pointers to two elements of an array gives the difference between
their indexes.
D. All the above
4. What will be the output of the following program ?
A. 0
B. 4
C. 5
D. 6
5. An entire array is always passed by to a called function.
UNIVERSITI TEKNOLOGI MARA
TEST 1
COURSE : PROGRAMMING II
COURSE CODE : CSC404
DATE : MARCH 2024
TIME : 1.45 HOURS
INSTRUCTIONS TO CANDIDATES
1. Answer ALL questions.
2. This question paper consists of two(3) parts: PART A (5 Questions)
PART B (3 Questions)
PART C (2 Questions)
3. Do not bring any material into the examination room unless permission is given by
the invigilator.
NAME :
MATRIC NO :
GROUP :
LECTURER :
DO NOT TURN THIS PAGE UNTIL
This examination paper consists of 6 printed
pages
, PART A (10 marks)
1. The declaration
int (*p) [10];
means
A. p is a pointer to a 10 elements integer array.
B. p is a one dimensional array of size 10, of pointers to integers.
C. The same as int *p[
D. None of these.
2. Which of the following is a complete function?
A. int funct();
B. int funct(int x) { return x=x+1; }
C. void funct(int) { cout<<“Hello"; }
D. void funct(x) { cout<<“Hello"; }
3. Choose a correct statement with array pointers.
A. It is valid to add an integer number to an array pointer. Result can be anything
B. It is valid to subtract an integer number from an array pointer. Results can be
anything.
C. Difference of pointers to two elements of an array gives the difference between
their indexes.
D. All the above
4. What will be the output of the following program ?
A. 0
B. 4
C. 5
D. 6
5. An entire array is always passed by to a called function.