In order for a software to be public domain, it needs not to be copyrighted. So only non-copyrighted open source softwares may qualify as public domain (rather than open source!)
And if you want a program you have written to be in the public domain, you must take some legal steps to disclaim the copyright on it; otherwise, the program is copyrighted