Computer Science, asked by ritikak792, 6 months ago

Assume y be an array. Which of the following operations are incorrect?
I. ++y

II. y+1

III. y++

IV. y*2

Select one:
a. I and II
b. I, III and IV
c. II and III
d. I, II and III

Answers

Answered by Anonymous
8

\huge\red{Answer}IV. y*2

\huge\green{Explanation}int y[10]; * y will store the base address of array. *

Statement I, III and IV is invalid.

Statement I and III : ++y and y++ are throwing en error while compile (l value required as increment operand )

Since, y is storing in the address of the array which is static value which cannot be change by the operand.

Statement IV : y*2 is also throw an error while compile (invalid operands to binary * (have 'int *' and 'int') )

Statement II : y+1 is throw a warning: assignment makes integer from pointer without a cast [enabled by default]

\huge\orange{@alurringbabe}

Similar questions