I don't need a round-off value ,help me out...
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); /*Amountip = 1,00,000*/ int month1 = amount /10; int balanceAm = amount-month1; int month2 = balanceAm/10; balanceAm = balanceAm-month2; int month3 = balanceAm/10; balanceAm = balanceAm-month3; int month4 = balanceAm/10; balanceAm = balanceAm-month4; int month5 = balanceAm/10; balanceAm = balanceAm-month5; float month6 = balanceAm/10; float x = month6 ; int value = (Math.round(x)); int finalAm = balanceAm-value; System.out.println(finalAm); // find the closest int for the double } } Expected out : 53144 But I got this output : 53145