program ex 2 part 1