Question: 2. Write a C++ program, called odd.cpp, that repeatedly reads integers from the user. . For each integer, the program should print the integer and
2. Write a C++ program, called odd.cpp, that repeatedly reads integers from the user. . For each integer, the program should print the integer and whether it is positive, negative, or zero-and whether it is odd or even. . The program should stop when a negative odd integer is entered The negative odd integer should be processed and printed. Processing this last input is a little different from our normal input driven loop that does not process this last value. What kind of control structure (loop) would this be? Hint: See page 313 and page 325 of the text. An ending message should be printed. Here is a sample run (user input in bold): Enter an integer (negative odd to stop): 3 Number: 3 Magnitude: Positive Type: Odd Enter an integer: -6 Number:-6 Magnitude: Negative Type: Even Enter an integer: Number: 0 Magnitude: Zero Type: Even Enter an integer: 44 Number: Magnitude: Positive Type: Even Enter an integer: 3 Number: Magnitude: Negative Type: 3 Odd How Odd
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
