Adding some C++ code

main program added