Create E2-4.cpp

Exercise 2.4