program to demonstrate how parent wait child