Magna International interview question

Simple math and C++ questions