Professional Documents
Culture Documents
Phase Test Chap 6,7
Phase Test Chap 6,7
SECTION-A
Times allowed: 15 Minutes Marks: 10
NOTE: Section-A is compulsory and comprises pages 1-2. All parts of this section are to be
answered on the question paper itself. It should be completed in the first 15 minutes and
handover to the Center superintendent. Deleting/overwriting is not allowed. Do not use lead
pencil.
Q.1 Encircle the correct option i.e. A/B/C/D. All parts carry equal marks.
i. The phenomenon of having two or more functions in a program with the same names but
diffdifferent numbers and types of parameter is known as:
a) Inline function
b) Nested function
c) Function overloading
d) Recursive function
ii. We declare a function with_______________if it does not have any return type.
a) long b) double c) void d) int
iii. Arguments of a functions are separated with:
a) Comma(.)
b) Semicolon(;)
c) Colon(:)
d) None of these
iv. Variables inside parenthesis of function declaration have_______________level access?
a) Local b) Global c) Module d) Universal
v. In pointer dereference operator (*) is used
a) Address the value of pointer variable
b) Points to the value stored in the variable pointed by the pointer variable
c) Both a and b
d) None
vi. A pointer is:
a) Operator b) Keyword c) Data type d) Variable
viii. The process to access data in variable using * operator with pointer variable is called:
a) Dereferencing the pointer
b) Referencing the pointer
c) Accessing the pointer
d) None
ix. Which of the following indicates the address of a variable temp of type float:
a) *temp
b) &temp
c) &float temp
d) float temp&
x. The statement int *p; has the same meaning as:
a) int p;
b) int *p
c) *int ptr;
d) int p*;
Q.2 Attempt any FIVE parts from the following. All parts carry equal marks. (5 X 3 = 15)
i. What is a function? List any three benefits of using function.
ii. What is difference between user-defined function and built-in function.
iii. What is difference between function definition and function declaration.
iv. What is a function call.
v. What is difference between local variable and global variable.
vi. Differentiate between call by reference and call by value. When would you use one over
the other ?
vii. What is the main advantage of using inline function.
Q.3 Attempt any FIVE parts from the following. All parts carry equal marks. (5 X 3 = 15)
i. Why are pointer used.
ii. Write any three advantages of using pointer.
iii. How is a pointer variable declared.
iv. What is memory address.
v. What type of pointer can store the address of any type of variable.
vi. How the declaration of pointer variable is different from the declaration of simple variable.
vii. What is the difference between dereference operator (*) and reference operator(&).
Note: Attempt any TWO questions. All questions carry equal marks (5 X 2 = 10)
Q.4 Write a C++ program having function name rectangle and read the length and width of rectangle
from the keyboard and find the area of rectangle. The result should be returned to the main program for
displaying on the screen. (05)
Q.5 Write a C++ program to explain the concept of void pointer. (05)
Q.6 Write a note on the following. (05)
a) Default arguments
b) Void pointer