The real answer is somewhere around 409.9999999.
This also outputs doublerounding to 410, because the math is all built in:
std::cout << 400+(sin((90*3.14159)/180)*10) << std::endl;
as yposdeclared as int, a double value is truncated to 409(this is a specific behavior when casting from doubleto int):
ypos=ypos+(sin((90*3.14159)/180)*10);
std::cout << ypos << std::endl;
, , PI:
const double PI = 3.141592653589793238463;
std::cout << 400+(sin((90*PI)/180)*10) << std::endl;
double int, . , :
ypos += round(sin((90*PI)/180)*10);