I'm having trouble rounding up to the next integer, because of integer truncation. Basically, I want x/n (both integers) to be 9 but I keep getting 8. How do I divide two integers and get an integer that is the rounded up version of the actual decimal number? Simply using ceil(25.0/3.0) won't work for me, because in my actual program, x and n are integer values input by the user.
Also, why isn't the 3rd line I tried below able to run? Whenever I try to typecast inside the ceil function, I get a message saying "undefined reference to ceil."
int x = 25;
int n = 3;
int numOfStrings = ceil(((double)x) / n);