changed myprogA to return int as per problem specification