Accept an integer and Print hello world n times in loop Get link Facebook X Pinterest Email Other Apps February 07, 2024 // Accept an integer and Print hello world n times let a = Number ( prompt ( "enter the number" )) for ( let i = 0 ; i < a ; i ++ ){ console . log ( "hello world" ) } Read more
for in loop Get link Facebook X Pinterest Email Other Apps February 07, 2024 let student = { name: "rahul kumar", age: 20, cgpa: 7.5, ispass : true, } for (let key in student){ console.log("key=", key, "value=", student[key] ) } Read more
How to create Even number 1 to 100 with for loop Get link Facebook X Pinterest Email Other Apps February 07, 2024 for(var i = 0; i <= 100; i++){ if (i % 2 === 0){ console.log(i) } } Read more
How to create odd number 1 to 100 with for loop Get link Facebook X Pinterest Email Other Apps February 07, 2024 for(var i = 0; i <= 100; i++){ if (i % 2 !== 0){ console.log(i) } } Read more