I am unable to findout the problem with the code below. I get warning message "operation on 'ptr' may be undefined" on printf statement. Also the the result is printed in reverse order (7 is printed aganst Element1 and 2 against element2)
int main()
{
int a[4] = {2,7,9,0};
int *ptr=a;
printf("Element1 = %d Element 2 = %d", *ptr, *ptr++);
ptr++;
return 0;
}