Conversion program using C++