Code of exercise 3
Code for ex03