- 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 50
quot;); } else { System.out.println("Try again"); } } }

18th Jun 2021, 3:48 AM
Мирбек Исмаилов
Мирбек Исмаилов - avatar
2 Answers
+ 2
in the "if" you need to remove the "int". using int variables are created
18th Jun 2021, 3:58 AM
SammE
SammE - avatar
0
Thanks
18th Jun 2021, 6:11 AM
Мирбек Исмаилов
Мирбек Исмаилов - avatar