Statement 1 Result : Compile error.
Operator
'=' has a higher priority than the operator ",". the comma acts as a delimiter. the compiler creates the integer variable "i" and initializes it with "1". The compiler cannot create the integer variable "2" because "2" is not a valid index.
Statement 2 Result: i=3
Operator
'() takes precedence over' = '. So, firstly, the parenthesis operator is computed. The '()' operator works from left to right. but it is always the result of the latter, which is assigned.
Statement 3: Result: i=1
Operator
'=' has a higher priority than the operator ",". therefore, 'i' is initialized to '1'. '2' and '3' are just a constant expression. therefore have no effect.
Shashank jain
source share