In this, *++ptr will increment the pointer first and then assign the value pointed by the pointer to the variable. *ptr++ will first assign the value pointed by the pointer to the variable.
So,
a=*++ptr; will cause the pointer point to 'a' in "MadeEasy" first and then assign the value 'a' to variable a
b=*ptr++ will cause first assign value 'a' to the variable b and then shift the pointer to d
similarly, in second iteration,
a=*++ptr; will cause a to store e (as pointer is shifted first)
b=*ptr++ will cause b to store e (e is assigned and pointer now points to E)
and in last iteration, a and b both will contain the character 'a'.
Hence a a will be printed