Ola bom dia!
Estou tentando resolver um exercício e parece que a minha lógica não está correcta.
O problema:
var number = 42
Use a for loop to go through all numbers from number up to 50 (both inclusive), and check if they are multiples of 3. If they are, print them.
O meu raciocinio:
var number = 42;
for(var number = 42; number <= 50; number++)
if (0 == number % 3){
console.log(number +' is a multiple of 3');
}
A saida:
Code is incorrect
You should have an if statement to check if each value of the variable number is a multiple of 3
42 is a multiple of 3
45 is a multiple of 3
48 is a multiple of 3