+ 1

What is wrong in solving?

int a[]={3,2,6,7,0,58}; int *p=a; printf(”%d\n",*p); printf("%d %d",*p++,*++p); As postfix has more precedence than pre, first *p++ would be calculated it would return 3 and p will increment, and then *++p here first p would be incremented and it will return 6... This is how I solved it... So o/p should be 3 36 But I get this o/p 3 22 .... https://code.sololearn.com/clW2jwiuMNDU/?ref=app https://code.sololearn.com/clW2jwiuMNDU/?ref=app

10th Dec 2021, 12:20 PM
Soham Kulkarni
Soham Kulkarni - avatar
1 Odpowiedź