Reason (R) : 'a' is 'const' type pointer.
This question concerns the behavior of array names and the increment operator (++) in the C programming language, evaluating an Assertion (A) and a Reason (R).
Assertion (A): "In 'C' language, if 'a' is name of an array and '++' operator is used to increment the value of 'a' then compiler will flag an error."
According to the provided correct answer, this assertion is considered false. In C, an array name like 'a' typically decays into a pointer to its first element. Attempting to apply the increment operator directly to the array name (e.g., $a++$ or $++a$) is an invalid operation because the array identifier represents a constant address, not a modifiable l-value. Standard C compilers *do* flag this as an error. However, adhering strictly to the provided answer key indicates this assertion is treated as false.
Reason (R): "'a' is 'const' type pointer."
This statement is true. In the context of expressions, an array name in C behaves like a pointer to its first element, but this pointer is constant. Its value, which is the base memory address of the array, cannot be changed or incremented using operators like $++$. This inherent constant nature is the underlying reason why operations like $a++$ fail.
Since Assertion (A) is deemed false and Reason (R) is true, we select the option that reflects this specific combination.
Which among the following is a valid string function?
A function which calls itself is called a
Which of the following function sets first n characters of a string to a given character?
Which of the following statement provides an easy way to dispatch execution to different parts of code based on the value of the expression?
Which of the following operators has left to right associativity?