#include <stdio.h>
int main(void)
{
int xi;
float xf = 6.9;
xi = (int)xf;
printf("truncated: %d\n", xi
);
xi = (int)(xf+0.5);
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKQp7CglpbnQgeGk7CglmbG9hdCB4ZiA9IDYuOTsKCQoJcHJpbnRmKCJmbG9hdDogJS4yMGZcbiIsIHhmKTsKCQoJeGkgPSAoaW50KXhmOwoJcHJpbnRmKCJ0cnVuY2F0ZWQ6ICVkXG4iLCB4aSk7CgkKCXhpID0gKGludCkoeGYrMC41KTsKCXByaW50Zigicm91bmRlZDogJWRcbiIsIHhpKTsKCQp9