Coding Zone
Sunday, November 14, 2010
Round Up Values in C
# include <stdio.h>
# include <conio.h>
void main()
{
double d;
int i;
clrscr();
d=8.5;
i=(d<0)?d-0.5:d+0.5;
printf("The round up value is ::%d",i);
getch();
}
Output: The round up value is ::9
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment