#include<stdio.h>
#include<conio.h>
void main()
{
char n[10];
int i,j,k,m;
clrscr();
printf("\n\n PLEASE ENTER THE VALUE OF N: ");
scanf("%s",n);
for(i=0,j=0;n[i]!='.';i++)
j++;
for(i=0,k=0;n[i]!='\0';i++)
k++;
k--;
for(i=k;i>j+2;i--)
{
if(n[i] < '5')
n[i]='\0';
if(n[i] >= '5')
{
n[i-1]=n[i-1]+1;
n[i]='\0';
}
}
printf("\n\n AFTER ROUND OF N %s",n);
getch();
}
--------------------------------- OUTPUT ---------------------------------
PLEASE ENTER THE VALUE OF N: 12.362514
AFTER ROUND OF N 12.36
--------------------------------------------------------------------------