Create mag.cpp
Merge pull request #5 from krishnraj/patch-3

Create mag.cpp