+ 1
Write a javascript code to display even number from 2-20 using while loop
10 Respostas
+ 2
something like :
for(var i =2 ; i <= 20; i++) {
if ( i % 2 ==0){
console.log(i);
{
{
+ 2
that is for a for loop.
use the same logic to create it with while loop.
+ 1
hint : write it using a loop and an if condition with the modulus %.
+ 1
Tq
+ 1
Do u know the codding of this
+ 1
Tqsm
+ 1
for(let i = 2; i <=20; i +=2){
console.log(i);
}
+ 1
The JS tutorial you started a month ago should help with while loops 😉