- 2
What is wrong with this code?
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); int number = read.nextInt(); int a = 10; int b = 9; int x = 4; int y = 6; if (number%a == 0 && number%b == 0) { System.out.println("You won 200
quot;); } else if (number%x == 0 || number%y == 0) { System.out.println("You won 50quot;); } else { System.out.println("Try again"); } } }2 Respostas
+ 2
in the "if" you need to remove the "int". using int variables are created
0
Thanks