+ 1

M getting errors in this can anyone check that for me ?

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int loadAmount = scanner.nextInt(); int numOfMonths = 1; int loanAmount; int paymeny; int remainingAmount = 0; System.out.println("Enter the loan amount: "); while(numOfmonths <= 3) { payment = (10*loanAmount)/100; remainingAmount =(loanAmount - payment); loanAmount = remainingAmount ; numOfMonths++; } } }

17th Dec 2021, 2:39 PM
Saumya Maurya
Saumya Maurya - avatar
1 Answer
+ 1
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int loanAmount = scanner.nextInt(); int numOfmonths = 1; int payment; int remainingAmount = 0; System.out.println("Enter the loan amount: "); while(numOfmonths <= 3) { payment = (10*loanAmount)/100; remainingAmount =(loanAmount - payment); loanAmount = remainingAmount ; numOfmonths++; } } }
17th Dec 2021, 2:52 PM
JaScript
JaScript - avatar