+ 1
Why it shows wrong output when I write (10/100*amount) instead of (amount*10/100)
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); for(int i=0 ; i<3 ; i++) { amount-= (amount*10/100) ; } System.out.println(amount); } }
4 Respuestas
+ 1
Now I got! Thank you
+ 1
result= amt*10;
b= result/100;
0
so it shows wrong result, not error..