By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,731 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,731 IT Pros & Developers. It's quick & easy.

algorithm for printing specific odd numbers

P: 1
printing odd numbers between one to ninety nine(99)
Nov 18 '15 #1
Share this Question
Share on Google+
2 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
Read up on the % modulus operator.
Nov 18 '15 #2

Expert 100+
P: 2,398
The modulus operator provides a way to test if a particular number is even or odd. However, if you know you need to start from 1, and if you're allowed to know that The starting number is guaranteed to be odd, then you need a rule for computing the next odd number from the previous odd number.
Nov 19 '15 #3

Post your reply

Sign in to post your reply or Sign up for a free account.