How come destructor execute the below code? When the destructor is invoked after exit from main method??

~complesx()
{
cout << "How is it possible"
}

When I run my next program w/o clear screen, I can see this previous o/p "How is it possible"

My questions are?
If destructor is invoked after exit from main method, how is it possible to execute the print statement when there is no prototyping available?
From where it includes the file <stdio.h> or <conio.h>??