modified program11.10.c