C/C++: How to round up a number


#include 
intergerVariable = ceil (floatVariable);

To compile with math.h library you MUST include the -lm flag.

gcc -lm main.c

Advertisements

This post is also available in: Greek

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.