Question: Complete the following code segment by writing an if statement that tests whether the integer stored in the variable x is positive and odd, or
Complete the following code segment by writing an if statement that tests whether the integer stored in the variable x is positive and odd, or negative and even. Display the message "x is positive and odd" if x is positive and odd, or "x is negative and even" if x is negative and even. Note: The if statement should always work without modification and regardless of the value stored in the variable x. int x =-10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
