0

Loan calculator

In question it is said that loan is claculates for 3 months so I'm iterating for 3 times. But it's giving error. Plz help me fixing it out . This is the code for loan calculator import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); //your code goes here for(i=0;i<3;i++){ amount -= (amount *10)/100; System.out.println(amount ); } } }

3rd Oct 2021, 12:50 AM
Anjali Singh
Anjali Singh - avatar
2 odpowiedzi
+ 2
Anjali Singh You haven't declared the type for i for(int i=0; etc....
3rd Oct 2021, 12:57 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Yes I fixed it thanks.
3rd Oct 2021, 1:00 AM
Anjali Singh
Anjali Singh - avatar