Image that a bit is the smallest measure in programming, such as an elementary particle in physics. So, a bit can only fit one number.
Is this computer science?
If so, then the function you would need for your code is this...
_____
if (someValue%2 != 0) {
value *= -1;
}
_____
//basically <u>number%2 == 0</u> means even so "!" means false so "not even" meaning "odd."
Assuming you are doing an array list (given a set value) or a for-loop with an
int someValue = Integer.parseInt(args[i]); inside (not given a set value and not restricted)
Otherwise ignore me....lol
Yes. Blogging Serves a large purpose. It helps with advertisement and over all feedback.