Hi i hoping that someone could help me with a couple of lines of code for C
I want it to do a devision but if the answer is a decimal then it rounds it up to the next integer eg: 23/3 = 8 thanks
Printable View
Hi i hoping that someone could help me with a couple of lines of code for C
I want it to do a devision but if the answer is a decimal then it rounds it up to the next integer eg: 23/3 = 8 thanks
Code:#include <math.h>
.....
int op1 = 23;
int op2 = 3;
// Always round up.
int result = (int) ceil( (double)op1/ (double)op2);