Write code to round numbers?
#include <stdio.h>
#include <stdlib.h>
int roundedNumber(double num);
int main()
{
int num = roundedNumber(5.56);
printf("%d\n", num);
return 0;
}
int roundedNumber(double num){
return (int)(num < 0 ? (num - 0.5) : (num + 0.5));
}