Do you know how to set up a program where if you enter a number then you use IF and make it so if the integer is between two numbers it does one thing because when i try if(a>1,a<10), it messes up the program. Thank you.
Do you know how to set up a program where if you enter a number then you use IF and make it so if the integer is between two numbers it does one thing because when i try if(a>1,a<10), it messes up the program. Thank you.
howbout you try this:
if(a<1 && a <10) //says 'if a is under 1 and(&&) a is under 10
if(a<1 || a<10) // says 'if a under 1 or(||) a is under 10
obviously you have to use the logical operations.
&& = and
|| = or
And remember if you want it to be between 2 numbers, to use
<=
>=
This way it will stop on those numbers. Otherwise it would stop one less than or one greater than a or b.
C++ Is Powerful
I use C++
There fore I am Powerful