public decimal check(decimal
a, decimal b, decimal
c)
{
decimal
no = ((a * b) / c);
decimal
ceil, floor, temp, result;
ceil = Math.Ceiling(no);
temp = ceil - no;
decimal
compare = new decimal(0.5);
if
(temp <= compare)
{
//prints
ceil
result = ceil;
}
else
{
//print
floor
floor = Math.Floor(no);
result = floor;
}
return
result;
}
After Decimal point value compare with 0.5 if it is equal or grater than 0.5 next highest number will be considered other wise decimals removed and only the number will be considered.
Eg: if your no gets 123.49 then the result is 123,if it is 123.51 then the result is 124