As people here have said, your output is wrong because you increment ptr before printing its content.
The reason you are getting values like "-858993460" is
ptr = arr sets ptr to the arrays memory location. The way this works is, arr has a specific memory location and reserves that memory location and all the ones following it until memorylocation+(length-1).
So assuming arr is at location "15007140".
Then you set the values on each memory location as following:
15007140 = 1
15007144 = 2
15007148 = 3
15007152 = 4
15007156 = 5
Doing ptr=arr essentially sets ptr=15007140. When calling (*ptr) you get access to the value in memory location 15007140. doing ptr++ increases 15007140 to 15007144. if you call (*ptr) you get access to the value in that location, which is 2 in this case.
if you increase ptr further and further, you can actually increase it beyond 15007156 (which is the end of the array), thus getting access to memory addresses and their values, which are no direct part of your code (as you saw with the -858993460 in your case).
Because ptr starts at the address of the first array position, doing ptr++; before printing, you end up printing the value of array position arr[1] first, and printing "arr[6]" last (but because your array is only of length 5, "arr[6]" is actually something unrelated to your array within your memory)
"Correct" code would be:
for (int i = 0; i < 5; i++) {
(*ptr) += 2;
printf("%d\r\n", ptr);
ptr++;
}
i++, ptr ++) or after printf.