Pointers – Point Out Correct Statements

1. Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?

A. float **fun(float***);
B. float *fun(float**);
C. float fun(float***);
D. float ****fun(float***);

Correct Answer: D. float ****fun(float***);

2. Which of the statements is correct about the program?

Screenshot 1

A. j and i are pointers to an int
B. i is a pointer to an int and stores address of j
C. j is a pointer to an int and stores address of i
D. j is a pointer to a pointer to an int and stores address of i

Correct Answer: C. j is a pointer to an int and stores address of i

3. Which of the statements is correct about the program?

Screenshot 2

A. It prints ASCII value of the binary number present in the first byte of a float variable a.
B. It prints character equivalent of the binary number present in the first byte of a float variable a.
C. It will print 3
D. It will print a garbage value

Correct Answer: A. It prints ASCII value of the binary number present in the first byte of a float variable a.

4. In the following program add a statement in the function fun() such that address of a gets stored in j?

Screenshot 3

A. **k=a;
B. k=&a;
C. *k=&a
D. &k=*a

Correct Answer: C. *k=&a

5. Which of the following statements correct about k used in the below statement?
char ****k;

A. k is a pointer to a pointer to a pointer to a char
B. k is a pointer to a pointer to a pointer to a pointer to a char
C. k is a pointer to a char pointer
D. k is a pointer to a pointer to a char

Correct Answer: B. k is a pointer to a pointer to a pointer to a pointer to a char

Leave A Comment?

8 + 2 =