• + 1 comment

    try this for round off::

    int roundNo(float num)

    { return num < 0 ? num - 0.5 : num + 0.5; }