Even the delete operator is executed, the last two output statements are working same the first two output statements..
How is this possible...?????????????????
When you free memory, it may or may not be reused immediately for something else. If it is not reused, you can still access the pointer and get what was there before. But it is not safe to rely on that behavior because there is no way to tell if the memory was reused. The only way to guarantee that you own the memory is not to free it until you are really done with it.
Technically your code invokes undefined behavior because you use a pointer to access memory after it was freed. Undefined behavior is very bad because it makes your program totally unpredictable.