0
Help w/ Being Choosy Excercise
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); int number = read.nextInt(); //your code goes here int i = 0; while (i <= number && number % 3 == 0) { System.out.println(i); i++; } } ^ STUCK ON THIS EXCERCISE
1 Respuesta
- 1
First of all, you wrote && (and) and you need OR ||.
Like this:
//your code goes here
int i = 1;
while (number >=i) {
if (i%3==0 || i%10==3){
System.out.println(i); }
i++;
}