The document outlines a unit test on pointers, consisting of multiple-choice questions worth one mark each and descriptive questions worth three marks each. It tests knowledge on pointer declaration, initialization, advantages, and operations, as well as error identification in a code segment. The test includes practical programming tasks related to pointers and arrays.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
5 views2 pages
Ganga P U College Unit Test
The document outlines a unit test on pointers, consisting of multiple-choice questions worth one mark each and descriptive questions worth three marks each. It tests knowledge on pointer declaration, initialization, advantages, and operations, as well as error identification in a code segment. The test includes practical programming tasks related to pointers and arrays.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
GANGA P U COLLEGE UNIT TEST:POINTERS MARKS:25
I. Answer for the following Questions carries one Mark:
1. Pointer is used to store ___ A) Memory address B) Value C) Data D) Information 2. Which of the following is the correct way to declare a pointer? A) int *ptr; B) int ptr; C) int &ptr; D) All 3. Which of the following operators is used for declare pointer and initialize pointer? A) ~ and & B) & and * C) = and = D) * and = 4. In the given program segment identify the error. void main() { int *ptr, x=18; Ptr =*x; Cout<<”\n Output is “<<ptr; } A) Unknown Identifier B) Runtime Error C) Invalid Indirection D) Statement Missing I. Answer for the following Questions carries three marks: 1. What are the advantages of pointers? 2. Write the syntax for declaration a pointer. 3. Write Initialization of a pointer with example. 4. Write a note on: a) The address of operator (&) b) Pointer Operator or Indirection Operator (*) 5. Write operation can be performed and operations cannot be performed on pointers. 6. Write a program to shows the relationship between pointer and one-dimensional array. 7. What is array of pointer? Give example
GANGA P U COLLEGE UNIT TEST:POINTERS MARKS:25
I. Answer for the following Questions carries one Mark: 1. Pointer is used to store ___ A) Memory address B) Value C) Data D) Information 2. Which of the following is the correct way to declare a pointer? A) int *ptr; B) int ptr; C) int &ptr; D) All 3. Which of the following operators is used for declare pointer and initialize pointer? A) ~ and & B) & and * C) = and = D) * and = 4. In the given program segment identify the error. void main() { int *ptr, x=18; Ptr =*x; Cout<<”\n Output is “<<ptr; } A) Unknown Identifier B) Runtime Error C) Invalid Indirection D) Statement Missing I. Answer for the following Questions carries three marks: 1. What are the advantages of pointers? 2. Write the syntax for declaration a pointer. 3. Write Initialization of a pointer with example. 4. Write a note on: a) The address of operator (&) b) Pointer Operator or Indirection Operator (*) 5. Write operation can be performed and operations cannot be performed on pointers. 6. Write a program to shows the relationship between pointer and one-dimensional array. 7. What is array of pointer? Give example