c++ how to change a double to a int code example Example: double to int c++ double x = 5.4; int y = (int) x;