# Print odd numbers

Write a function to print odd numbers from 0 to given limit using JavaScript

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if youâ€™re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess Iâ€™d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://www.freecodecamp.org/learn.

With your current questions, we donâ€™t have enough context to know what you already know or donâ€™t know, so it is impossible to guide you without just telling you the answer (which we wonâ€™t do).

It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what youâ€™ve tried and Iâ€™m sure youâ€™ll get more help.

Happy coding

I tried doing this but itâ€™s giving me syntax error.

``````function odd(n)
for(i = 0, i <= N, i++){
if(i % 2 != 0){
console.log(i)
}
}
``````

@vinaykanth-edu, your logic is correct but you have a few syntax errors. Run your code through this; http://www.pythontutor.com/javascript.html#mode=edit

Note that, like all programming languages, JS is case-sensitive. â€śNâ€ť is not the same as â€śnâ€ť, itâ€™s a completely different character.

And as @Roma says, you have another syntax error: look at an example of how you write a function, you are missing the brackets.

1 Like

Except Fortran. Because Fortran is terrible.

2 Likes

And donâ€™t forget Pascal.

1 Like

Fortran is full of sadness. Powerful numerical capabilities trapped with trash syntax conventions.

Thank you, I was using comma instead of semicolon in the for loop.

Hahaha, no way. I knew thereâ€™d be few when I typed the words, I was just too lazy to check

Also

The book description is summat else. I mean it is probably super useful if you are in a position where you gotta use Fortran butâ€¦

Edit: haha I hadnâ€™t really.clocked the quote until I posted that. Surely that means he would have spent more time writing his calculations if heâ€™d had the book?? (I assume itâ€™s second language, but the editors could have corrected him, jeez)

You forgot about BASIC (for most dialects I believe). My first programming language on my Amstrad 464. So much fun when you canâ€™t save the program you spend half a day typing out from a book (well I never figure out how to save it anyway).