when the pointer points to other point and to other,this forms a pointer chain system. first pointers container address of second pointer .second pointer contains the address of third pointer and goes on. When one pointer points to another pointer it is called a double pointer.
here,from the above program .ptr1 holds the address of var. and ptr2 hold the address of ptr1 and ptr2 cannot hold the address of var. in the output statement if we put pointers they will return the value of variable .so 12,13,14 lines gives same out put.15th line and 18th lines gives the same output because address of var and value stored in ptr1 is same.