+ 1
How to execute first 10 odd numbers in javascript
I need a full code how to solve it
12 Respuestas
+ 8
Its is very simple u need one loop and loop start form 0 to 10. And u need condition for odd Numbers if number%2! ==0 then print Numbers.
This hint is enough to solve this problem
+ 8
Muskan welcome
+ 3
Do not ask for code pls,link your code ,so we can see what you attempted and provide you further assistance
+ 1
Muskan
I visited your profile just now. Seems you only just getting started, so I would advise you to finish the course for now, and put the idea on hold. At least until you get to "Conditionals and loops" chapter, where you will be learning about repetition : )
0
I don't even know which typ of code is written their
0
You could've been more descriptive with the question actually.
How "execute first 10 odd numbers" sound to you?
Besides, there could be more to it, for example, the range bounds, whether to begin from zero, or any number. Range direction also is unclear here, is it 10 odd numbers upwards or backwards from the initial number : )
0
Ipang upward
0
<script>
for(let i=0; i<=10; i++) {
if(i%2!==0){
console.log(`even numbers ${i} `)
}
}
</script>
This is the code you are looking for. You can also do this. If you know loops and if statements.
Before asking questions. Try by yourself. If get stuck. Link your code with your question here on Q&A Discussion.
0
🇮🇳Vivek🇮🇳 thank you
0
🐍Sizuna 🐉 thank you for the cooperation