# For loops to test an prime number

Please, I need some help to solve this problem!

Challenge is:

What should be the expressions in the instruction below to test whether a given number is prime (divisible only by 1 and itself) or not?

In the code image, you can see the space where I can make changes to better understand the challenge. I can only make changes in the [initialization]; [condition] as you see in the example on the attached image.

beneath you can see my tried code

``````let n = 17; // the commands below can work for any values of n

let prime = true;
for(let i = 1; i > n; i--)
if(n%i == 0) // Tests whether n is divisible by i
prime = false;
console.log(`\${n} \${!prime?"no ":""} is a prime number.`);
``````

Note - its best to use {} with your loops and if statements

hi ! so I have tried many ways but none of them print to me the correct answer.
So the first try was for ( let i = 0 ; i > n ; i–) and it did not work.
That was my last try.

however the answer has to print prime and non-prime numbers when I change the variable N