Classical

C Programming MCQ - Pointers

16:  

A pointer variable can be

A.

passed to a function as argument

B.

changed within a function

C.

returned by a function

D.

can be assigned an integer value

 
 

Option: C

Explanation :


17:  

Which of the following operators can be applied to pointer variable(s)?

A.

Division 

B.

Multiplication

C.

Casting

D.

None of these

 
 

Option: C

Explanation :


18:  

Consider the following program.
main() 
{
char x[10], *ptr = x;
scanf("%s", x);
change(&x[4]);

change ( char a[ ] )
{
puts(a);

}
If abcdefg is the input, the output will be

A.

abcd

B.

abc

C.

efg

D.

garbage

 
 

Option: C

Explanation :


19:  

Pick the correct answers.
If x is an one dimensional array, then

A.

&x [i] is same as x + i - 1

B.

* (x + i ) is same as * (&x [i] )

C.

* (x + i) is same as x[i]

D.

both (b) & (c0

 
 

Option: D

Explanation :


20:  

Let x be an array. Which of the following cannot be present in the left hand side of an assignment statement?

A.

x

B.

&x[i]

C.

x + i

D.

All of these

 
 

Option: D

Explanation :




Suggest an improvement