Professional Documents
Culture Documents
a. *
b. &
c. ()
d. **
a. &myChar
b. *myChar
c. **myChar
d. myChar
char *ptr ;
char Str = 'P';
ptr = &Str;
Str +=5;
cout << Str;
cout << endl;
cout << *ptr;
S P
a. b.
S S
U U
c. d.
S U
4. Which of the following CORRECTLY accesses the ninth element of array Number1 with the size
of 11?
a. Number1 [9];
b. Number (9);
c. Number [10];
d. Number (10);
6. _________________ is the keyword used in C++ for a function with return value, and
_________________ for a function with no return value
a. Void , parameter
b. Return, double
c. Return, Void
d. Void, Return
a. Prototype variables
b. Local variables
c. Global variables
d. Block Variables
i. A list
ii. A table
iii. An array of arrays
a. i only
b. i and ii
c. ii and iii
d. i and iii
9. What is the output of the following code fragment?
a. 1 b. 0 c. -1 d. 10
(4marks)
a. Write a C++ program segment for the function func(n) that computes the
total sequence in the series.
(3 marks)
b. Write a C++ program segment that calls the function for the value 10 and
display the series as follows:
Write a C++ code that can store the monthly sale of six salespersons for the first six months in
two-dimensional array. Your program must consist of the following tasks: