Also there is a little syntax error at the end of 2 program .one closing bracket is missing.

admins please correct this

thank you