Question:

Given below are two statements :
one is labelled as
Assertion (A) and the other is labelled as
Reason (R).
Assertion (A) :
++*ptr in C increments the value pointed by ptr.
Reason (R) :
ptr is a pointer.
In the light of the above statements, choose the most appropriate answer from the options given below :

Show Hint

Unary operators go Right-to-Left! ++*ptr means increment the value. If you wanted to increment the address, you'd use *++ptr.
Updated On: Jun 6, 2026
  • Both (A) and (R) are correct and (R) is the correct explanation of (A)
  • Both (A) and (R) are correct but (R) is not the correct explanation of (A)
  • (A) is correct but (R) is not correct
  • (A) is not correct but (R) is correct
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

This question involves operator precedence and pointer arithmetic in C. 1. Analyzing Assertion (A): In the expression ++*ptr, we have the prefix increment operator (++) and the indirection operator (*). Both are unary operators that have the same precedence and associate from right to left.
• First, *ptr is evaluated to fetch the value at the memory address.
• Second, the ++ operator increments that fetched value. As the value is incremented, Assertion (A) is correct. 2. Analyzing Reason (R): The statement "ptr is a pointer" is a factual requirement; without ptr being a pointer, the * operator could not be used. Thus, Reason (R) is correct. 3. Evaluating the Linkage: While ptr must be a pointer for the expression to be valid, being a pointer is not the reason why the value is incremented instead of the address. The behavior is determined by operator precedence and associativity rules. For example, *ptr++ would increment the pointer address instead. Therefore, (R) is not the correct explanation of (A).
Was this answer helpful?
0
0

Top CUET PG Data Science A.I Cyber Security and Computer Sci. Questions

View More Questions

Top CUET PG Programming and Data Structures Questions

View More Questions