0

I have been searching the whole f.day where is my mistake and finally i just realize its the > sign i just make it x >=3 . Omg

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 int x; int y = 0; int z = 0; for(x = 1; x <= 3; x++){ y = amount / 10; z = amount - y; amount = z; } System.out.println(amount); } }

3rd Nov 2021, 8:00 PM
NattaN 45
NattaN 45 - avatar
1 Answer
+ 6
It's okay to make mistakes, it's part of learning. No mistake is only possible with no try. But maybe next time you may use the Feeds for personal notifications 👌
3rd Nov 2021, 8:20 PM
Ipang