determining how many odd numbers from n1 to n2

hey guys, can anyone help me?.
i need a program that will count how many odd numbers there is from 1-100
using only ifelse statement or for loop...
Last edited on
Do you have any code? We can't really help you without any code to look at.
+1 to what firedraco said. To start, think about how you could use the modulo operator (%) to find out if a certain integer is an odd number.

http://www.cplusplus.com/doc/tutorial/operators/
I dont get it, why do you need a program for this ? Isnt the answer 50 by a trivial analysis ?
@DexterMorgan
Homework exercises, I presume. He's too lazy to make his own, so he asks here (no offence).
Topic archived. No new replies allowed.