Update cachematrix.R

Updating the programme in the similar way as given on coursera for the fullfillment of the ourse....