Math Program for beginner written on c++